import math

n = int(raw_input())

def isPrime(a):
    if a==2 or a==3:
        return 1
    if a<2 or a%2==0:
        return 0
        
    i = int(math.sqrt(a))+1
    for x in xrange(3,i):
        if a%x==0:
            return 0
    return 1

cnt = 0
for _ in xrange(n):
    a = int(raw_input())
    cnt += isPrime(a)
print cnt import math math n = int(raw_input()) n int(raw_input()) int raw_input() raw_input def isPrime(a):
    if a==2 or a==3:
        return 1
    if a<2 or a%2==0:
        return 0
        
    i = int(math.sqrt(a))+1
    for x in xrange(3,i):
        if a%x==0:
            return 0
    return 1 isPrime if a==2 or a==3:
        return 1
     a==2 or a==3 a==2 a 2 a==3 a 3 return 1 1 if a<2 or a%2==0:
        return 0
        
     a<2 or a%2==0 a<2 a 2 a%2==0 a%2 a 2 0 return 0 0 i = int(math.sqrt(a))+1 i int(math.sqrt(a))+1 int(math.sqrt(a)) int math.sqrt(a) math.sqrt math sqrt a 1 for x in xrange(3,i):
        if a%x==0:
            return 0
     x xrange(3,i) xrange 3 i if a%x==0:
            return 0
     a%x==0 a%x a x 0 return 0 0 return 1 1 a a cnt = 0 cnt 0 for _ in xrange(n):
    a = int(raw_input())
    cnt += isPrime(a) _ xrange(n) xrange n a = int(raw_input()) a int(raw_input()) int raw_input() raw_input cnt += isPrime(a) cnt isPrime(a) isPrime a print def isPrime(a):
    if a==2 or a==3:
        return 1
    if a<2 or a%2==0:
        return 0
        
    i = int(math.sqrt(a))+1
    for x in xrange(3,i):
        if a%x==0:
            return 0
    return 1 def isPrime(a):
    if a==2 or a==3:
        return 1
    if a<2 or a%2==0:
        return 0
        
    i = int(math.sqrt(a))+1
    for x in xrange(3,i):
        if a%x==0:
            return 0
    return 1 isPrime a = int(raw_input()) int(raw_input()) a cnt += isPrime(a) isPrime(a) cnt n = int(raw_input()) int(raw_input()) n cnt = 0 0 cnt
import math

n = int(raw_input())

def isPrime(a):
    if a==2 or a==3:
        return 1
    if a<2 or a%2==0:
        return 0
        
    i = int(math.sqrt(a))+1
    for x in xrange(3,i):
        if a%x==0:
            return 0
    return 1

cnt = 0
for _ in xrange(n):
    a = int(raw_input())
    cnt += isPrime(a)
print cnt