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

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

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