let prime_p n =
  if n == 2 then true
  else if n < 2 || n mod 2 = 0 then false
  else begin
    let x = int_of_float (sqrt (float_of_int n)) in
    let rec doit i =
      if i > x then true
      else if n mod i = 0 then false
      else doit (i + 2)
    in
    doit 3
  end

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)