fork download
  1. count = int(input())
  2.  
  3. result = 0
  4.  
  5. for i in range(count) :
  6. word = input()
  7. if len(list(set(word))) == 1:
  8. result += 1
  9. continue
  10. for j in range(len(word) - 1) :
  11. if word[j] == word[j+1] :
  12. pass
  13. elif word[j] in word[j+1:] :
  14. break
  15. else :
  16. result+=1
  17. break
  18.  
  19. print(result)
Success #stdin #stdout 0.04s 9728KB
stdin
1
abcb
stdout
1