licznik=0x=int(input())while x!=0: if x%3==0: licznik=licznik+1 x=int(input())print(licznik)
1 2 10 42 11 0
1
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!