import re

s = input()

ans1 = re.findall(r'min', s)
ans2 = re.findall(r'mi[-]+n', s)

print(len(ans1) + len(ans2))