def get_prime_list(max)
  list = (2..max).to_a
  prime_list = []
  sqrt = max**0.5
  while val = list.shift
    prime_list << val
    if val > sqrt
      break
    end
    list.delete_if{|n| n%val==0}
  end
  return prime_list.concat(list)
end

def is_prime(num,list)
  if list.include?(num)
    return true
  else
    flag = true
    for p in list do
      if num%p==0
        flag = false
        break
      end
    end
    return flag
  end
end

list = get_prime_list(10000)
n = gets.chomp.to_i
count = 0
for i in 1..n do
  num = gets.chomp.to_i
  if is_prime(num,list)
    count += 1
  end
end
printf("%d\n",count)
