import re S = input() pat = re.compile(r'm.*?n') print(len(pat.findall(S)))