let find_prime n =
  let b = ref true in
  let i = ref 3 in
  while (float_of_int !i) <= sqrt (float_of_int n) do
    if n mod !i = 0 then b := false;
    i := !i + 2
  done;
  !b


let is_prime n =
  match n with
  | 0 -> false
  | 1 -> false
  | 2 -> true
  | x when x mod 2 = 0 -> false
  | _ -> find_prime n


let () =
  let n = read_int () in
  let sum = ref 0 in
  for i = 1 to n do
    let num = read_int () in
    if is_prime num then sum := !sum + 1
  done;
  print_int !sum; print_newline ()