import sys

count = 0

number = int(input())

for line in sys.stdin:
    n = int(line)
    if n == 2:
        count += 1
        continue

    if n % 2 == 0:
        continue

    jdg = True
    for i in range(3, int(n ** 0.5) + 1, 2):
        if n % i == 0:
            jdg = False
            break
    if jdg:
        count += 1

print(count)
 import sys sys count = 0 count 0 number = int(input()) number int(input()) int input() input for line in sys.stdin:
    n = int(line)
    if n == 2:
        count += 1
        continue

    if n % 2 == 0:
        continue

    jdg = True
    for i in range(3, int(n ** 0.5) + 1, 2):
        if n % i == 0:
            jdg = False
            break
    if jdg:
        count += 1 line sys.stdin sys stdin n = int(line) n int(line) int line if n == 2:
        count += 1
        continue

     n == 2 n 2 count += 1 count 1 continue if n % 2 == 0:
        continue

     n % 2 == 0 n % 2 n 2 0 continue jdg = True jdg True for i in range(3, int(n ** 0.5) + 1, 2):
        if n % i == 0:
            jdg = False
            break
     i range(3, int(n ** 0.5) + 1, 2) range 3 int(n ** 0.5) + 1 int(n ** 0.5) int n ** 0.5 n 0.5 1 2 if n % i == 0:
            jdg = False
            break
     n % i == 0 n % i n i 0 jdg = False jdg False break if jdg:
        count += 1 jdg count += 1 count 1 print(count) print count n = int(line) int(line) n count += 1 1 count jdg = True True jdg jdg = False False jdg number = int(input()) int(input()) number count = 0 0 count count += 1 1 count
import sys

count = 0

number = int(input())

for line in sys.stdin:
    n = int(line)
    if n == 2:
        count += 1
        continue

    if n % 2 == 0:
        continue

    jdg = True
    for i in range(3, int(n ** 0.5) + 1, 2):
        if n % i == 0:
            jdg = False
            break
    if jdg:
        count += 1

print(count)

