Uses crt; var i,k:integer; begin k:=0; for i:=1000 to 9999 do if (i mod 2<>0) and (i mod 3<>0) then inc(k); writeln(k); end.