S = input()
count = len(S)
i = 0
for j in range(len(S)):
if i < len(S)-2 and (S[i] == 'd' and S[i+1] == 'z' and S[i+2] == '='):
count = count - 1
i = i + 1
if ((S[i] == 'c' and S[i+1] == '=') or
(S[i] == 'c' and S[i+1] == '-') or
(S[i] == 'd' and S[i+1] == '-') or
(S[i] == 'l' and S[i+1] == 'j') or
(S[i] == 'n' and S[i+1] == 'j') or
(S[i] == 's' and S[i+1] == '=') or
(S[i] == 'z' and S[i+1] == '=') ):
count = count - 1
if i >= len(S)-1:
break
i = i + 1
print(count)
UyA9IGlucHV0KCkKY291bnQgPSBsZW4oUykKCmkgPSAwCmZvciBqIGluIHJhbmdlKGxlbihTKSk6CiAgICBpZiBpIDwgbGVuKFMpLTIgYW5kIChTW2ldID09ICdkJyBhbmQgU1tpKzFdID09ICd6JyBhbmQgU1tpKzJdID09ICc9Jyk6CiAgICAgICAgY291bnQgPSBjb3VudCAtIDEKICAgICAgICBpID0gaSArIDEKICAgIGlmICgoU1tpXSA9PSAnYycgYW5kIFNbaSsxXSA9PSAnPScpIG9yCiAgICAgICAgKFNbaV0gPT0gJ2MnIGFuZCBTW2krMV0gPT0gJy0nKSBvcgogICAgICAgIChTW2ldID09ICdkJyBhbmQgU1tpKzFdID09ICctJykgb3IKICAgICAgICAoU1tpXSA9PSAnbCcgYW5kIFNbaSsxXSA9PSAnaicpIG9yCiAgICAgICAgKFNbaV0gPT0gJ24nIGFuZCBTW2krMV0gPT0gJ2onKSBvcgogICAgICAgIChTW2ldID09ICdzJyBhbmQgU1tpKzFdID09ICc9Jykgb3IKICAgICAgICAoU1tpXSA9PSAneicgYW5kIFNbaSsxXSA9PSAnPScpICk6CiAgICAgICAgY291bnQgPSBjb3VudCAtIDEKICAgIGlmIGkgPj0gbGVuKFMpLTE6CiAgICAgICAgYnJlYWsKICAgIGkgPSBpICsgMQpwcmludChjb3VudCkK