import math
n = int(input())
n_p = 0
for i in range(n):
    a = int(input())
    if a == 2:
        n_p += 1
        continue
    elif a % 2 == 0:
        continue
    else:
        j = 3
        while j <= math.sqrt(a):
            if a%j == 0:
                break
            j += 2
        else:
            n_p += 1
print(n_p) import math math n = int(input()) n int(input()) int input() input n_p = 0 n_p 0 for i in range(n):
    a = int(input())
    if a == 2:
        n_p += 1
        continue
    elif a % 2 == 0:
        continue
    else:
        j = 3
        while j <= math.sqrt(a):
            if a%j == 0:
                break
            j += 2
        else:
            n_p += 1 i range(n) range n a = int(input()) a int(input()) int input() input if a == 2:
        n_p += 1
        continue
    elif a % 2 == 0:
        continue
    else:
        j = 3
        while j <= math.sqrt(a):
            if a%j == 0:
                break
            j += 2
        else:
            n_p += 1 a == 2 a 2 n_p += 1 n_p 1 continue elif a % 2 == 0:
        continue
     a % 2 == 0 a % 2 a 2 0 continue j = 3 j 3 while j <= math.sqrt(a):
            if a%j == 0:
                break
            j += 2
        else:
            n_p += 1 j <= math.sqrt(a) j math.sqrt(a) math.sqrt math sqrt a if a%j == 0:
                break
             a%j == 0 a%j a j 0 break j += 2 j 2 n_p += 1 n_p 1 print(n_p) print n_p n_p += 1 1 n_p n_p = 0 0 n_p n_p += 1 1 n_p j = 3 3 j j += 2 2 j n = int(input()) int(input()) n a = int(input()) int(input()) a
import math
n = int(input())
n_p = 0
for i in range(n):
    a = int(input())
    if a == 2:
        n_p += 1
        continue
    elif a % 2 == 0:
        continue
    else:
        j = 3
        while j <= math.sqrt(a):
            if a%j == 0:
                break
            j += 2
        else:
            n_p += 1
print(n_p)