fork download
  1. S = input()
  2. count = len(S)
  3.  
  4. i = 0
  5. for j in range(len(S)):
  6. if i < len(S)-2 and (S[i] == 'd' and S[i+1] == 'z' and S[i+2] == '='):
  7. count = count - 1
  8. i = i + 1
  9. if ((S[i] == 'c' and S[i+1] == '=') or
  10. (S[i] == 'c' and S[i+1] == '-') or
  11. (S[i] == 'd' and S[i+1] == '-') or
  12. (S[i] == 'l' and S[i+1] == 'j') or
  13. (S[i] == 'n' and S[i+1] == 'j') or
  14. (S[i] == 's' and S[i+1] == '=') or
  15. (S[i] == 'z' and S[i+1] == '=') ):
  16. count = count - 1
  17. if i >= len(S)-1:
  18. break
  19. i = i + 1
  20. print(count)
  21.  
Success #stdin #stdout 0.04s 9692KB
stdin
testdz=
stdout
5