fork download
  1. word=""
  2. word=input()
  3. alphabet= ["dz=", "c=", "c-", "lj", "d-", "nj", "s=", "z="]
  4. start, count = 0, 0,
  5. while 1:
  6. for i in alphabet:
  7. if word[start:].find(i)>=0:
  8. count += 1
  9. if i == "dz=":
  10. start += 3
  11. continue
  12. start += 2
  13. continue
  14. else:
  15. break
  16. print(count+(len(word)-start))
Success #stdin #stdout 0.03s 9720KB
stdin
ljes=njak
stdout
7