import re
for i in range(7):
	print(len(re.findall("[cprt]h|dd|ff|ng|ll|.",input())))