Consider using collections.Counter