fork download
  1. for _ in range(3):
  2. s = input().strip()
  3. count_k = s.count('k')
  4.  
  5. if count_k == 0:
  6. print(0)
  7. elif count_k == 1:
  8. print(s.index('k') + 1)
  9. else:
  10. print(count_k)
Success #stdin #stdout 0.11s 14132KB
stdin
Lo hghkbhvfdgtttt
Yhjjllga
kknhjgvhghkkvthbbygk
stdout
7
0
5