# https://atcoder.jp/contests/zone2021/tasks/zone2021_a


print(input().count('ZONe'))

# kw = 'ZONe'
# s = input()
# ans = 0
# for i in range(len(s)-3):
#     if s[i:i+4]==kw:
#         ans += 1
# print(ans)
