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