import std.stdio;void main(){for(int n,s;~scanf("%s",&s);)s%3?n++:writeln(--n);}