import sys stats={} for line in sys.stdin: words = line.split() for word in words: for ch in word: if ch in stats: stats[ch] = stats[ch] + 1 else: stats[ch] = 1 print stats