import math

def prime_number(num):
    if num == 2:
        return 1
    elif num%2 != 0:
        for j in range(3, int(math.sqrt(num))+1, 2):
            if num%j == 0:
                return 0
        return 1
    else:
        return 0

n = int(raw_input())

count = 0
for i in range(n):
    num = int(raw_input())
    if prime_number(num) == 1:
        count += 1

print count
            