import random

def is_prime3(q, k=50):
    q = abs(q)
    #?¨???????????????§?????????????????§????????????????????????
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    #n-1=2^s*d??¨????????????a?????´??°???d????\???°)???d????±???????
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    #?????????k?????°?????????
    for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        #[0,s-1]??????????????????????????§??????
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True

if __name__=="__main__":
    n = int(input())
    a = []
    for i in range(n):
        a.append(int(input()))
    b = []
    for i in range(n):
        b.append(is_prime3(a[i]))
    print(b.count(True)) import random random def is_prime3(q, k=50):
    q = abs(q)
    #?¨???????????????§?????????????????§????????????????????????
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    #n-1=2^s*d??¨????????????a?????´??°???d????\???°)???d????±???????
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    #?????????k?????°?????????
    for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        #[0,s-1]??????????????????????????§??????
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True is_prime3 q = abs(q) q abs(q) abs q if q == 2: return True
     q == 2 q 2 if q < 2 or q&1 == 0: return False

    #n-1=2^s*d??¨????????????a?????´??°???d????\???°)???d????±???????
     q < 2 or q&1 == 0 q < 2 q 2 q&1 == 0 q&1 q 1 0 d = (q-1)>>1 d (q-1)>>1 q-1 q 1 1 while d&1 == 0:
        d >>= 1
    
    #?????????k?????°?????????
     d&1 == 0 d&1 d 1 0 d >>= 1 d 1 for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        #[0,s-1]??????????????????????????§??????
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
     i range(k) range k a = random.randint(1,q-1) a random.randint(1,q-1) random.randint random randint 1 q-1 q 1 t = d t d y = pow(a,t,q) y pow(a,t,q) pow a t q while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
         t != q-1 and y != 1 and y != q-1 t != q-1 and y != 1 t != q-1 t q-1 q 1 y != 1 y 1 y != q-1 y q-1 q 1 y = pow(y,2,q) y pow(y,2,q) pow y 2 q t <<= 1 t 1 if y != q-1 and t&1 == 0:
            return False
     y != q-1 and t&1 == 0 y != q-1 y q-1 q 1 t&1 == 0 t&1 t 1 0 return False False return True True q q k=50 k 50 if __name__=="__main__":
    n = int(input())
    a = []
    for i in range(n):
        a.append(int(input()))
    b = []
    for i in range(n):
        b.append(is_prime3(a[i]))
    print(b.count(True)) __name__=="__main__" __name__ "__main__" n = int(input()) n int(input()) int input() input a = [] a [] for i in range(n):
        a.append(int(input()))
     i range(n) range n a.append(int(input())) a.append a append int(input()) int input() input b = [] b [] for i in range(n):
        b.append(is_prime3(a[i]))
     i range(n) range n b.append(is_prime3(a[i])) b.append b append is_prime3(a[i]) is_prime3 a[i] a i print(b.count(True)) print b.count(True) b.count b count True n = int(input()) int(input()) n a = [] [] a b = [] [] b def is_prime3(q, k=50):
    q = abs(q)
    #?¨???????????????§?????????????????§????????????????????????
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    #n-1=2^s*d??¨????????????a?????´??°???d????\???°)???d????±???????
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    #?????????k?????°?????????
    for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        #[0,s-1]??????????????????????????§??????
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True def is_prime3(q, k=50):
    q = abs(q)
    #?¨???????????????§?????????????????§????????????????????????
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    #n-1=2^s*d??¨????????????a?????´??°???d????\???°)???d????±???????
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    #?????????k?????°?????????
    for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        #[0,s-1]??????????????????????????§??????
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True is_prime3
import random

def is_prime3(q, k=50):
    q = abs(q)
    #?¨???????????????§?????????????????§????????????????????????
    if q == 2: return True
    if q < 2 or q&1 == 0: return False

    #n-1=2^s*d??¨????????????a?????´??°???d????\???°)???d????±???????
    d = (q-1)>>1
    while d&1 == 0:
        d >>= 1
    
    #?????????k?????°?????????
    for i in range(k):
        a = random.randint(1,q-1)
        t = d
        y = pow(a,t,q)
        #[0,s-1]??????????????????????????§??????
        while t != q-1 and y != 1 and y != q-1: 
            y = pow(y,2,q)
            t <<= 1
        if y != q-1 and t&1 == 0:
            return False
    return True

if __name__=="__main__":
    n = int(input())
    a = []
    for i in range(n):
        a.append(int(input()))
    b = []
    for i in range(n):
        b.append(is_prime3(a[i]))
    print(b.count(True))