let is_prime n = match n with
    2|3|5|7 -> 1
    | n when n mod 2 = 0 -> 0
    | n ->
       let rec loop i =
         if i*i > n then 1
         else if n mod i = 0 then 0
         else loop (i+2);
       in loop 3

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