import math
n = int(input())
cnt = 0

def f(x):
    for i in range(2, int(math.sqrt(x))+1):
        if x%i == 0:
            return 0
    return 1

for i in range(n):
  m = int(input())
  cnt = cnt + f(m)

print(cnt)
