let is_prime n = match n with
    2|3 -> true
    | n when n mod 2 = 0 || n mod 3 = 0 -> false
    | n ->
       let rec loop = function
           i when i*i > n -> true
         | i -> if i mod n = 0 then false 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 (if is_prime m then ct+1 else ct) (i-1)
  in
  Printf.printf "%d\n" (read 0 n)