def pnj(a):
    i = 2
    while i*i <= a:
        if a%i == 0:
            return False
        i += 1
    return True

n = int(input())
i, c = 0, 0

while n > i:
    a = int(input())
    if pnj(a):
        c += 1
    i += 1

print(c)

