def isPrime(N):
    if N < 2: 
        return 0
    if N == 2: 
        return 1
    elif N % 2 == 0: 
        return 0
    for i in range(3,N):
        if N % 2 != 0:
            if N > i * i:
                i = i + 2
                if N % i == 0: 
                    return 0
    return 1

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

