import math
n=int(input())
s=0

for i in range(n):
    a=int(input())
    #b=int(a**0.5)
    b=math.ceil(a**0.5)
    #print(str(b), '??O') 
    if a==2:
        s+=1
   #     print(str(a),'!!!!')
    elif a%2==0 or a < 2:
        continue
    else:
        j=3
        c=0
        while j <= b:
            if a%j==0:
                c+=1
                break
            j+=2
        if c==0:
            s+=1
        """
        for j in range(3,b+1,2):
            if a%j==0:
                break
            if j==b:
                s+=1
                print(str(a),'!!!!')
"""
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=int(a**0.5)
    b=math.ceil(a**0.5)
    #print(str(b), '??O') 
    if a==2:
        s+=1
   #     print(str(a),'!!!!')
    elif a%2==0 or a < 2:
        continue
    else:
        j=3
        c=0
        while j <= b:
            if a%j==0:
                c+=1
                break
            j+=2
        if c==0:
            s+=1
        """
        for j in range(3,b+1,2):
            if a%j==0:
                break
            if j==b:
                s+=1
                print(str(a),'!!!!')
""" 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
   #     print(str(a),'!!!!')
    elif a%2==0 or a < 2:
        continue
    else:
        j=3
        c=0
        while j <= b:
            if a%j==0:
                c+=1
                break
            j+=2
        if c==0:
            s+=1
        """
        for j in range(3,b+1,2):
            if a%j==0:
                break
            if j==b:
                s+=1
                print(str(a),'!!!!')
""" 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 j=3 j 3 c=0 c 0 while j <= b:
            if a%j==0:
                c+=1
                break
            j+=2
         j <= b j b if a%j==0:
                c+=1
                break
             a%j==0 a%j a j 0 c+=1 c 1 break j+=2 j 2 if c==0:
            s+=1
         c==0 c 0 s+=1 s 1 """
        for j in range(3,b+1,2):
            if a%j==0:
                break
            if j==b:
                s+=1
                print(str(a),'!!!!')
""" print(s) print s j=3 3 j j+=2 2 j n=int(input()) int(input()) n b=math.ceil(a**0.5) math.ceil(a**0.5) b s+=1 1 s a=int(input()) int(input()) a s+=1 1 s c=0 0 c c+=1 1 c s=0 0 s
import math
n=int(input())
s=0

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