var a, k: integer;begin t:=0; readln(a); while a<>0 do begin if (a mod 2 = 0) and (a mod 6 = 0) then k := k + 1; readln(a);
end; writeln(k)end.