import math

def isprime(n):
    i = 2
    while i <= math.sqrt(n):
        if n % i == 0:
            return False
        i += 1
    
    return True

N = int(input())
lst = []
j = 0

for i in range(N):
  d = int(input())
  if isprime(d):
    j += 1

print(j)
