let rec pow x y =
  if y = 0 then 1
  else let z = pow (x*x) (y / 2) in if y mod 2 = 1 then x*z else z

let prime_p n =
  if n == 2 then true
  else if n < 2 || n mod 2 = 0 then false
  else if pow 2 (n - 1) mod n = 1 then true
  else false

let () =
  let n = read_int () in
  let rec read i cnt =
    if i >= n then cnt
    else read (i + 1) (cnt + (if prime_p (read_int ()) then 1 else 0))
  in
  Printf.printf "%d\n" (read 0 0)