import sys

readline = sys.stdin.readline

prime = set([2])

for i in range(3, 10000, 2):

    for j in prime:

        if i % j == 0:

            break

    else:

        prime.add(i)

n = int(eval(input()))

cnt = 0

for i in (int(readline()) for _ in range(n)):

    if i in prime:

        cnt += 1

        continue

    for j in prime:

        if i % j == 0:

            break

    else:

        cnt += 1

print(cnt)



from sys import stdin

import math

def isPrime(x):

    if x == 2 or x == 3: return True

    elif (x < 2 or x % 2 == 0 or x % 3 == 0): return False

    s = int(math.sqrt(x) + 1)

    for i in range(5, s + 1, 2):

        if x % i == 0: return False

    return True

print((sum([isPrime(int(stdin.readline())) for _ in range(int(stdin.readline()))])))



import sys

readline = sys.stdin.readline
prime = set([2])
for i in range(3, 10000, 2):
    for j in prime:
        if i % j == 0:
            break
    else:
        prime.add(i)
n = int(eval(input()))
cnt = 0
for i in (int(readline()) for _ in range(n)):
    if i in prime:
        cnt += 1
        continue
    for j in prime:
        if i % j == 0:
            break
    else:
        cnt += 1
print(cnt)

from sys import stdin
import math


def isPrime(x):
    if x == 2 or x == 3:
        return True
    elif x < 2 or x % 2 == 0 or x % 3 == 0:
        return False
    s = int(math.sqrt(x) + 1)
    for i in range(5, s + 1, 2):
        if x % i == 0:
            return False
    return True


print((sum([isPrime(int(stdin.readline())) for _ in range(int(stdin.readline()))])))

-import sys +from sys import stdin +import math -readline = sys.stdin.readline -prime = set([2]) -for i in range(3, 10000, 2): -    for j in prime: -        if i % j == 0: -            break -    else: -        prime.add(i) -n = int(eval(input())) -cnt = 0 -for i in (int(readline()) for _ in range(n)): -    if i in prime: -        cnt += 1 -        continue -    for j in prime: -        if i % j == 0: -            break -    else: -        cnt += 1 -print(cnt) + +def isPrime(x): +    if x == 2 or x == 3: +        return True +    elif x < 2 or x % 2 == 0 or x % 3 == 0: +        return False +    s = int(math.sqrt(x) + 1) +    for i in range(5, s + 1, 2): +        if x % i == 0: +            return False +    return True + + +print((sum([isPrime(int(stdin.readline())) for _ in range(int(stdin.readline()))])))