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