from collections import Counter
print(Counter(('foo', 'bar', 'foo')))