from collections import Counter s = input() x = Counter(s) print(x["m"])