Var a:real;k2,k5:integer; begin k2:=0; k5:=0; read(a); while a<>0 do begin if a=2 then k2:=k2+1 else if a=5 then k5:=k5+1; read(a) end; write(k2,' ',k5) end.