def isPrime(n):
    if n == 1:
        return False
    elif n == 2 or n == 3:
        return True
    else:
        for i in range(2, n//2+1):
            if n % i == 0:
                return False
        return True


N = int(input())
count = 0
for _ in range(N):
    if isPrime(int(input())):
        count += 1
print(count)


