import math
N = int(input())
ans = 0

for i in range(N):
    num = int(input())
    if num == 2:
        ans +=1
        continue
    rt = math.ceil(math.sqrt(num))
    div = 2
    bool = True
    while (rt >= div):
        if num % div:
            div += 1
        else:
            bool = False
            break
    if bool:
        ans += 1
print(ans)
 import math math N = int(input()) N int(input()) int input() input ans = 0 ans 0 for i in range(N):
    num = int(input())
    if num == 2:
        ans +=1
        continue
    rt = math.ceil(math.sqrt(num))
    div = 2
    bool = True
    while (rt >= div):
        if num % div:
            div += 1
        else:
            bool = False
            break
    if bool:
        ans += 1 i range(N) range N num = int(input()) num int(input()) int input() input if num == 2:
        ans +=1
        continue
     num == 2 num 2 ans +=1 ans 1 continue rt = math.ceil(math.sqrt(num)) rt math.ceil(math.sqrt(num)) math.ceil math ceil math.sqrt(num) math.sqrt math sqrt num div = 2 div 2 bool = True bool True while (rt >= div):
        if num % div:
            div += 1
        else:
            bool = False
            break
     rt >= div rt div if num % div:
            div += 1
        else:
            bool = False
            break
     num % div num div div += 1 div 1 bool = False bool False break if bool:
        ans += 1 bool ans += 1 ans 1 print(ans) print ans ans +=1 1 ans bool = False False bool N = int(input()) int(input()) N div = 2 2 div bool = True True bool div += 1 1 div ans = 0 0 ans num = int(input()) int(input()) num rt = math.ceil(math.sqrt(num)) math.ceil(math.sqrt(num)) rt ans += 1 1 ans
import math
N = int(input())
ans = 0

for i in range(N):
    num = int(input())
    if num == 2:
        ans +=1
        continue
    rt = math.ceil(math.sqrt(num))
    div = 2
    bool = True
    while (rt >= div):
        if num % div:
            div += 1
        else:
            bool = False
            break
    if bool:
        ans += 1
print(ans)

