import sys
import re
from collections import Counter

c = Counter(re.split(r'[\-.,\s;:?!]+', sys.stdin.read().strip()))

for w, i in sorted(c.items()):
  if w:
    print "{0}:{1}".format(w, i)
print "_________________________________\n"
for w, i in c.most_common():
  if w:
    print "{0}:{1}".format(w, i)
