# -*- coding: utf-8 -*-
from math import sqrt
from bisect import bisect

def inpl(): return tuple(map(int, input().split()))

def isprime(N, P):
    if N <= 1:
        return False
    for p in P[:bisect(P, sqrt(N))]:
        if N%p==0:
            return False
            break
    else:
        return True

def primes(N):
    P = [2]
    searched = [False]*(N+1)
    for i in range(3, N+1, 2):
        if searched[i]:
            continue
        P.append(i)
        for j in range(i, N+1, i):
            searched[j] = True
    return P

P = primes(int(sqrt(10**8)))

res = 0
for i in range(int(input())):
    res += isprime(int(input()), P)
print(res) from math import sqrt from bisect import bisect def inpl(): return tuple(map(int, input().split())) inpl def isprime(N, P):
    if N <= 1:
        return False
    for p in P[:bisect(P, sqrt(N))]:
        if N%p==0:
            return False
            break
    else:
        return True isprime if N <= 1:
        return False
     N <= 1 N 1 return False False for p in P[:bisect(P, sqrt(N))]:
        if N%p==0:
            return False
            break
    else:
        return True p P[:bisect(P, sqrt(N))] P :bisect(P, sqrt(N)) bisect(P, sqrt(N)) bisect P sqrt(N) sqrt N if N%p==0:
            return False
            break
     N%p==0 N%p N p 0 return False False break return True True N N P P def primes(N):
    P = [2]
    searched = [False]*(N+1)
    for i in range(3, N+1, 2):
        if searched[i]:
            continue
        P.append(i)
        for j in range(i, N+1, i):
            searched[j] = True
    return P primes P = [2] P [2] 2 searched = [False]*(N+1) searched [False]*(N+1) [False] False N+1 N 1 for i in range(3, N+1, 2):
        if searched[i]:
            continue
        P.append(i)
        for j in range(i, N+1, i):
            searched[j] = True
     i range(3, N+1, 2) range 3 N+1 N 1 2 if searched[i]:
            continue
         searched[i] searched i continue P.append(i) P.append P append i for j in range(i, N+1, i):
            searched[j] = True
     j range(i, N+1, i) range i N+1 N 1 i searched[j] = True searched[j] searched j True return P P N N P = primes(int(sqrt(10**8))) P primes(int(sqrt(10**8))) primes int(sqrt(10**8)) int sqrt(10**8) sqrt 10**8 10 8 res = 0 res 0 for i in range(int(input())):
    res += isprime(int(input()), P) i range(int(input())) range int(input()) int input() input res += isprime(int(input()), P) res isprime(int(input()), P) isprime int(input()) int input() input P print(res) print res P = primes(int(sqrt(10**8))) primes(int(sqrt(10**8))) P def isprime(N, P):
    if N <= 1:
        return False
    for p in P[:bisect(P, sqrt(N))]:
        if N%p==0:
            return False
            break
    else:
        return True def isprime(N, P):
    if N <= 1:
        return False
    for p in P[:bisect(P, sqrt(N))]:
        if N%p==0:
            return False
            break
    else:
        return True isprime def inpl(): return tuple(map(int, input().split())) def inpl(): return tuple(map(int, input().split())) inpl res = 0 0 res res += isprime(int(input()), P) isprime(int(input()), P) res def primes(N):
    P = [2]
    searched = [False]*(N+1)
    for i in range(3, N+1, 2):
        if searched[i]:
            continue
        P.append(i)
        for j in range(i, N+1, i):
            searched[j] = True
    return P def primes(N):
    P = [2]
    searched = [False]*(N+1)
    for i in range(3, N+1, 2):
        if searched[i]:
            continue
        P.append(i)
        for j in range(i, N+1, i):
            searched[j] = True
    return P primes
# -*- coding: utf-8 -*-
from math import sqrt
from bisect import bisect

def inpl(): return tuple(map(int, input().split()))

def isprime(N, P):
    if N <= 1:
        return False
    for p in P[:bisect(P, sqrt(N))]:
        if N%p==0:
            return False
            break
    else:
        return True

def primes(N):
    P = [2]
    searched = [False]*(N+1)
    for i in range(3, N+1, 2):
        if searched[i]:
            continue
        P.append(i)
        for j in range(i, N+1, i):
            searched[j] = True
    return P

P = primes(int(sqrt(10**8)))

res = 0
for i in range(int(input())):
    res += isprime(int(input()), P)
print(res)
