import math
n=int(input())
s=0
for i in range(n):
    a=int(input())
    b=math.ceil(a**0.5)
    if a==2:
        s+=1
    elif a%2==0 or a < 2:
        continue
    else:
        c=0
        for j in range(3,b+1,2):
            if a%j==0:
                c+=1
                break
        if c==0:
            s+=1
print(s) import math math n=int(input()) n int(input()) int input() input s=0 s 0 for i in range(n):
    a=int(input())
    b=math.ceil(a**0.5)
    if a==2:
        s+=1
    elif a%2==0 or a < 2:
        continue
    else:
        c=0
        for j in range(3,b+1,2):
            if a%j==0:
                c+=1
                break
        if c==0:
            s+=1 i range(n) range n a=int(input()) a int(input()) int input() input b=math.ceil(a**0.5) b math.ceil(a**0.5) math.ceil math ceil a**0.5 a 0.5 if a==2:
        s+=1
    elif a%2==0 or a < 2:
        continue
    else:
        c=0
        for j in range(3,b+1,2):
            if a%j==0:
                c+=1
                break
        if c==0:
            s+=1 a==2 a 2 s+=1 s 1 elif a%2==0 or a < 2:
        continue
     a%2==0 or a < 2 a%2==0 a%2 a 2 0 a < 2 a 2 continue c=0 c 0 for j in range(3,b+1,2):
            if a%j==0:
                c+=1
                break
         j range(3,b+1,2) range 3 b+1 b 1 2 if a%j==0:
                c+=1
                break
         a%j==0 a%j a j 0 c+=1 c 1 break if c==0:
            s+=1 c==0 c 0 s+=1 s 1 print(s) print s s+=1 1 s s=0 0 s s+=1 1 s c+=1 1 c b=math.ceil(a**0.5) math.ceil(a**0.5) b n=int(input()) int(input()) n a=int(input()) int(input()) a c=0 0 c
import math
n=int(input())
s=0
for i in range(n):
    a=int(input())
    b=math.ceil(a**0.5)
    if a==2:
        s+=1
    elif a%2==0 or a < 2:
        continue
    else:
        c=0
        for j in range(3,b+1,2):
            if a%j==0:
                c+=1
                break
        if c==0:
            s+=1
print(s)