n = int(input())
given_list = []
for i in range(n):
    num = int(input())
    given_list.append(num)


def count_prime(given_list):
    count = 0
    for num in given_list:
        for i in range(2,num-1):
            if num % i ==0:
                break
        else:
            count += 1
    return count

print(count_prime(given_list))