fork download
  1. s = input()
  2.  
  3. max_count = 0
  4.  
  5. count = 0
  6.  
  7. for i in s:
  8.  
  9. if i == '1':
  10.  
  11. count += 1
  12.  
  13. if count > max_count:
  14.  
  15. max_count = count
  16.  
  17. else:
  18.  
  19. count = 0
  20.  
  21. print(max_count)
Success #stdin #stdout 0.03s 9356KB
stdin
01001111011
111111
00000
1010101
1100111110
stdout
4