def judge(n):
    if n < 2:
        return False
    if n == 2 or n == 3 or n == 5 or n == 7 or n == 11 or n == 13 or n == 17:
        return True
    if n % 2 == 0 or n % 3 == 0 or n % 5 == 0 or n % 7 == 0 or n % 11 == 0 or n % 13 == 0 or n % 17 == 0:
        return False
    i = 19
    while i < n:
        if n % i == 0:
            return False
        i += 1
    return True


N = int(input())
count = 0
for i in range(N):
    if (judge(int(input())) == True):
        count += 1

print(count)