import math

N = int(input())
ans = 0

def solve(x):
    if x==2:
        return 1
    elif x%2==0:
        return 0
    else:
        for i in range(3, math.ceil(math.sqrt(x)) + 1, 2):
            if x%i ==0:
                return 0
        return 1
for i in range(N):
    if solve(int(input())) ==1:
        ans +=1
print(ans) import math math N = int(input()) N int(input()) int input() input ans = 0 ans 0 def solve(x):
    if x==2:
        return 1
    elif x%2==0:
        return 0
    else:
        for i in range(3, math.ceil(math.sqrt(x)) + 1, 2):
            if x%i ==0:
                return 0
        return 1 solve if x==2:
        return 1
    elif x%2==0:
        return 0
    else:
        for i in range(3, math.ceil(math.sqrt(x)) + 1, 2):
            if x%i ==0:
                return 0
        return 1 x==2 x 2 return 1 1 elif x%2==0:
        return 0
     x%2==0 x%2 x 2 0 return 0 0 for i in range(3, math.ceil(math.sqrt(x)) + 1, 2):
            if x%i ==0:
                return 0
         i range(3, math.ceil(math.sqrt(x)) + 1, 2) range 3 math.ceil(math.sqrt(x)) + 1 math.ceil(math.sqrt(x)) math.ceil math ceil math.sqrt(x) math.sqrt math sqrt x 1 2 if x%i ==0:
                return 0
         x%i ==0 x%i x i 0 return 0 0 return 1 1 x x for i in range(N):
    if solve(int(input())) ==1:
        ans +=1 i range(N) range N if solve(int(input())) ==1:
        ans +=1 solve(int(input())) ==1 solve(int(input())) solve int(input()) int input() input 1 ans +=1 ans 1 print(ans) print ans def solve(x):
    if x==2:
        return 1
    elif x%2==0:
        return 0
    else:
        for i in range(3, math.ceil(math.sqrt(x)) + 1, 2):
            if x%i ==0:
                return 0
        return 1 def solve(x):
    if x==2:
        return 1
    elif x%2==0:
        return 0
    else:
        for i in range(3, math.ceil(math.sqrt(x)) + 1, 2):
            if x%i ==0:
                return 0
        return 1 solve ans +=1 1 ans ans = 0 0 ans N = int(input()) int(input()) N
import math

N = int(input())
ans = 0

def solve(x):
    if x==2:
        return 1
    elif x%2==0:
        return 0
    else:
        for i in range(3, math.ceil(math.sqrt(x)) + 1, 2):
            if x%i ==0:
                return 0
        return 1
for i in range(N):
    if solve(int(input())) ==1:
        ans +=1
print(ans)