S = input().strip() count = 0 i = 0 n = len(S) while i < n: if i + 1 < n and S[i] == 'm' and S[i+1] == 'i': j = i + 2 while j < n and S[j] == '-': j += 1 if j < n and S[j] == 'n': count += 1 i = j + 1 else: # According to the problem statement, this case will not occur i += 1 else: i += 1 print(count)