import std.stdio;int m,s;void main(){for(;~scanf("%s",&s);)m+=s%2*m?writeln(m/3),-m:1;}