# Arup Guha
# 3/16/2026
# Solution to 2026 UCF HS Contest Problem F: Toby Talks

# Get input.
word = input().strip()

# Store answer here.
res = 0

# We don't have to worry about run time, so just do brute force!
for i in range(len(word)-3):
    if word[i:i+4] == "meow":
        res += 1

# Ta da!
print(res)
