import math
cnt = 0
N = int(input())
for n in range(N):
    i = int(input())
    if i == 2\
    or i == 3\
    or i == 5\
    or i == 7:
        cnt += 1
    elif i % 2 == 0:
        continue
    else:
        j = 3
        prime = 1
        while j >= 3 and j <= int(math.sqrt(i)):
            if i % j == 0:
                prime = 0
                break
                
            j += 2
        if prime == 1:
            cnt += 1

print(cnt) import math math cnt = 0 cnt 0 N = int(input()) N int(input()) int input() input for n in range(N):
    i = int(input())
    if i == 2\
    or i == 3\
    or i == 5\
    or i == 7:
        cnt += 1
    elif i % 2 == 0:
        continue
    else:
        j = 3
        prime = 1
        while j >= 3 and j <= int(math.sqrt(i)):
            if i % j == 0:
                prime = 0
                break
                
            j += 2
        if prime == 1:
            cnt += 1 n range(N) range N i = int(input()) i int(input()) int input() input if i == 2\
    or i == 3\
    or i == 5\
    or i == 7:
        cnt += 1
    elif i % 2 == 0:
        continue
    else:
        j = 3
        prime = 1
        while j >= 3 and j <= int(math.sqrt(i)):
            if i % j == 0:
                prime = 0
                break
                
            j += 2
        if prime == 1:
            cnt += 1 i == 2\
    or i == 3\
    or i == 5\
    or i == 7 i == 2\
    or i == 3\
    or i == 5 i == 2\
    or i == 3 i == 2 i 2 i == 3 i 3 i == 5 i 5 i == 7 i 7 cnt += 1 cnt 1 elif i % 2 == 0:
        continue
     i % 2 == 0 i % 2 i 2 0 continue j = 3 j 3 prime = 1 prime 1 while j >= 3 and j <= int(math.sqrt(i)):
            if i % j == 0:
                prime = 0
                break
                
            j += 2
         j >= 3 and j <= int(math.sqrt(i)) j >= 3 j 3 j <= int(math.sqrt(i)) j int(math.sqrt(i)) int math.sqrt(i) math.sqrt math sqrt i if i % j == 0:
                prime = 0
                break
                
             i % j == 0 i % j i j 0 prime = 0 prime 0 break j += 2 j 2 if prime == 1:
            cnt += 1 prime == 1 prime 1 cnt += 1 cnt 1 print(cnt) print cnt cnt = 0 0 cnt cnt += 1 1 cnt N = int(input()) int(input()) N i = int(input()) int(input()) i prime = 0 0 prime cnt += 1 1 cnt prime = 1 1 prime j += 2 2 j j = 3 3 j
import math
cnt = 0
N = int(input())
for n in range(N):
    i = int(input())
    if i == 2\
    or i == 3\
    or i == 5\
    or i == 7:
        cnt += 1
    elif i % 2 == 0:
        continue
    else:
        j = 3
        prime = 1
        while j >= 3 and j <= int(math.sqrt(i)):
            if i % j == 0:
                prime = 0
                break
                
            j += 2
        if prime == 1:
            cnt += 1

print(cnt)