S = input() print(len([x for x in S if x == "m"]))