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


n = int(input())

ans = 0
for i in range(n):
    x = int(input())
    ans += 1 if judge(x) else 0

print(ans)

