let prime_p = function
  | 2 -> true
  | n when n < 2 || n mod 2 = 0 -> false
  | n ->
      let rec doit i =
        if i*i > n then true
        else if n mod i = 0 then false
        else doit (i + 2)
      in
      doit 3

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)