let rec range x y = if x > y then [] else x :: range (x+1) y

let isPrime n =
  if n = 2 then true
  else
    range 2 (int_of_float (sqrt (float n)))
      |> List.map (fun x -> n mod x = 0)
      |> List.for_all (fun x -> not x)

let () =
  let counter = ref 0 in
  let n = Scanf.scanf "%d\n" (fun x -> x) in
  for i = 1 to n do
    let m = Scanf.scanf "%d\n" (fun x -> x) in
    if isPrime m then counter := !counter + 1 else ();
  done;
  Printf.printf "%d\n" !counter

      