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