# Aizu Problem ALDS_1_1_C: Prime Numbers
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")

def primes2(n):
    """ Input n>=6, Returns a list of primes, 2 <= p < n """
    n, correction = n-n%6+6, 2-(n%6>1)
    sieve = [True] * (n//3)
    for i in range(1,int(n**0.5)//3+1):
      if sieve[i]:
        k=3*i+1|1
        sieve[      k*k//3      ::2*k] = [False] * ((n//6-k*k//6-1)//k+1)
        sieve[k*(k-2*(i&1)+4)//3::2*k] = [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1)
    return [2,3] + [3*i+1|1 for i in range(1,n//3-correction) if sieve[i]]

primes = primes2(10000)

def is_prime(k):
    if k in primes:
        return True
    r = math.sqrt(k)
    for p in primes:
        if k % p == 0:
            return False
        if p > r:
            return True
    return True

N = int(input())
cnt = 0
for _ in range(N):
    k = int(input())
    if is_prime(k):
        cnt += 1
print(cnt) import sys, math, os sys math os PYDEV = os.environ.get('PYDEV') PYDEV os.environ.get('PYDEV') os.environ.get os.environ os environ get 'PYDEV' if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt") PYDEV=="True" PYDEV "True" sys.stdin = open("sample-input.txt", "rt") sys.stdin sys stdin open("sample-input.txt", "rt") open "sample-input.txt" "rt" def primes2(n):
    """ Input n>=6, Returns a list of primes, 2 <= p < n """
    n, correction = n-n%6+6, 2-(n%6>1)
    sieve = [True] * (n//3)
    for i in range(1,int(n**0.5)//3+1):
      if sieve[i]:
        k=3*i+1|1
        sieve[      k*k//3      ::2*k] = [False] * ((n//6-k*k//6-1)//k+1)
        sieve[k*(k-2*(i&1)+4)//3::2*k] = [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1)
    return [2,3] + [3*i+1|1 for i in range(1,n//3-correction) if sieve[i]] primes2 """ Input n>=6, Returns a list of primes, 2 <= p < n """ n, correction = n-n%6+6, 2-(n%6>1) n n-n%6+6 n-n%6 n n%6 n 6 6 correction 2-(n%6>1) 2 n%6>1 n%6 n 6 1 sieve = [True] * (n//3) sieve [True] * (n//3) [True] True n//3 n 3 for i in range(1,int(n**0.5)//3+1):
      if sieve[i]:
        k=3*i+1|1
        sieve[      k*k//3      ::2*k] = [False] * ((n//6-k*k//6-1)//k+1)
        sieve[k*(k-2*(i&1)+4)//3::2*k] = [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1)
     i range(1,int(n**0.5)//3+1) range 1 int(n**0.5)//3+1 int(n**0.5)//3 int(n**0.5) int n**0.5 n 0.5 3 1 if sieve[i]:
        k=3*i+1|1
        sieve[      k*k//3      ::2*k] = [False] * ((n//6-k*k//6-1)//k+1)
        sieve[k*(k-2*(i&1)+4)//3::2*k] = [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1)
     sieve[i] sieve i k=3*i+1|1 k 3*i+1|1 3*i+1 3*i 3 i 1 1 sieve[      k*k//3      ::2*k] = [False] * ((n//6-k*k//6-1)//k+1) sieve[      k*k//3      ::2*k] sieve k*k//3      ::2*k k*k//3 k*k k k 3 2*k 2 k [False] * ((n//6-k*k//6-1)//k+1) [False] False (n//6-k*k//6-1)//k+1 (n//6-k*k//6-1)//k n//6-k*k//6-1 n//6-k*k//6 n//6 n 6 k*k//6 k*k k k 6 1 k 1 sieve[k*(k-2*(i&1)+4)//3::2*k] = [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1) sieve[k*(k-2*(i&1)+4)//3::2*k] sieve k*(k-2*(i&1)+4)//3::2*k k*(k-2*(i&1)+4)//3 k*(k-2*(i&1)+4) k k-2*(i&1)+4 k-2*(i&1) k 2*(i&1) 2 i&1 i 1 4 3 2*k 2 k [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1) [False] False (n//6-k*(k-2*(i&1)+4)//6-1)//k+1 (n//6-k*(k-2*(i&1)+4)//6-1)//k n//6-k*(k-2*(i&1)+4)//6-1 n//6-k*(k-2*(i&1)+4)//6 n//6 n 6 k*(k-2*(i&1)+4)//6 k*(k-2*(i&1)+4) k k-2*(i&1)+4 k-2*(i&1) k 2*(i&1) 2 i&1 i 1 4 6 1 k 1 3*i+1|1 for i in range(1,n//3-correction) if sieve[i] for i in range(1,n//3-correction) if sieve[i] i range(1,n//3-correction) range 1 n//3-correction n//3 n 3 correction sieve[i] sieve i if sieve[i] 3*i+1|1 3*i+1 3*i 3 i 1 1 return [2,3] + [3*i+1|1 for i in range(1,n//3-correction) if sieve[i]] [2,3] + [3*i+1|1 for i in range(1,n//3-correction) if sieve[i]] [2,3] 2 3 [3*i+1|1 for i in range(1,n//3-correction) if sieve[i]] n n primes = primes2(10000) primes primes2(10000) primes2 10000 def is_prime(k):
    if k in primes:
        return True
    r = math.sqrt(k)
    for p in primes:
        if k % p == 0:
            return False
        if p > r:
            return True
    return True is_prime if k in primes:
        return True
     k in primes k primes return True True r = math.sqrt(k) r math.sqrt(k) math.sqrt math sqrt k for p in primes:
        if k % p == 0:
            return False
        if p > r:
            return True
     p primes if k % p == 0:
            return False
         k % p == 0 k % p k p 0 return False False if p > r:
            return True
     p > r p r return True True return True True k k N = int(input()) N int(input()) int input() input cnt = 0 cnt 0 for _ in range(N):
    k = int(input())
    if is_prime(k):
        cnt += 1 _ range(N) range N k = int(input()) k int(input()) int input() input if is_prime(k):
        cnt += 1 is_prime(k) is_prime k cnt += 1 cnt 1 print(cnt) print cnt PYDEV = os.environ.get('PYDEV') os.environ.get('PYDEV') PYDEV N = int(input()) int(input()) N cnt += 1 1 cnt cnt = 0 0 cnt def primes2(n):
    """ Input n>=6, Returns a list of primes, 2 <= p < n """
    n, correction = n-n%6+6, 2-(n%6>1)
    sieve = [True] * (n//3)
    for i in range(1,int(n**0.5)//3+1):
      if sieve[i]:
        k=3*i+1|1
        sieve[      k*k//3      ::2*k] = [False] * ((n//6-k*k//6-1)//k+1)
        sieve[k*(k-2*(i&1)+4)//3::2*k] = [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1)
    return [2,3] + [3*i+1|1 for i in range(1,n//3-correction) if sieve[i]] def primes2(n):
    """ Input n>=6, Returns a list of primes, 2 <= p < n """
    n, correction = n-n%6+6, 2-(n%6>1)
    sieve = [True] * (n//3)
    for i in range(1,int(n**0.5)//3+1):
      if sieve[i]:
        k=3*i+1|1
        sieve[      k*k//3      ::2*k] = [False] * ((n//6-k*k//6-1)//k+1)
        sieve[k*(k-2*(i&1)+4)//3::2*k] = [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1)
    return [2,3] + [3*i+1|1 for i in range(1,n//3-correction) if sieve[i]] primes2 primes = primes2(10000) primes2(10000) primes k = int(input()) int(input()) k def is_prime(k):
    if k in primes:
        return True
    r = math.sqrt(k)
    for p in primes:
        if k % p == 0:
            return False
        if p > r:
            return True
    return True def is_prime(k):
    if k in primes:
        return True
    r = math.sqrt(k)
    for p in primes:
        if k % p == 0:
            return False
        if p > r:
            return True
    return True is_prime
# Aizu Problem ALDS_1_1_C: Prime Numbers
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")

def primes2(n):
    """ Input n>=6, Returns a list of primes, 2 <= p < n """
    n, correction = n-n%6+6, 2-(n%6>1)
    sieve = [True] * (n//3)
    for i in range(1,int(n**0.5)//3+1):
      if sieve[i]:
        k=3*i+1|1
        sieve[      k*k//3      ::2*k] = [False] * ((n//6-k*k//6-1)//k+1)
        sieve[k*(k-2*(i&1)+4)//3::2*k] = [False] * ((n//6-k*(k-2*(i&1)+4)//6-1)//k+1)
    return [2,3] + [3*i+1|1 for i in range(1,n//3-correction) if sieve[i]]

primes = primes2(10000)

def is_prime(k):
    if k in primes:
        return True
    r = math.sqrt(k)
    for p in primes:
        if k % p == 0:
            return False
        if p > r:
            return True
    return True

N = int(input())
cnt = 0
for _ in range(N):
    k = int(input())
    if is_prime(k):
        cnt += 1
print(cnt)