let is_prime n =
  if n = 2 || n = 3 || n = 5 then true
  else if n mod 2 = 0 || n mod 3 = 0 || n mod 5 = 0 then false
  else
    let rec loop i =
      if i*i > n then true
      else if n mod i = 0 then false
      else if n mod (i+2) = 0 then false
      else loop (i+6);
    in loop 5

let () =
  let n = read_int () in
  let rec read ct = function
      0 -> ct
    | i ->
       let m = read_int () in
       read (if is_prime m then ct+1 else ct) (i-1)
  in
  Printf.printf "%d\n" (read 0 n)