def isPrimeNumber(x):
    for i in range(2, int(x ** 0.5) + 1):
        if x % i == 0:
            return False
    return True

count = 0
for n in range(int(input())):
    count += 1 if isPrimeNumber(int(input())) else 0
print(count)
