How to set a program that count similar items in a string? : <p>I have this list</p>

<pre><code>dragonLoot = ['gold coin', 'dagger', 'gold coin', 'gold coin', 'ruby']
</code></pre>

<p>I need a function that would tell me that there is 3 gold coin, 1 dagger and 1 ruby in the dragon loot.</p>
