import math


def judge(n):
    if n < 2:
        return False
    i = 2
    while i <= math.sqrt(n):
        if n % i == 0:
            return False
        i += 1
    return True


count = 0
n = int(input())
for i in range(n):
    if judge(int(input())):
        count += 1
print(count) import math math def judge(n):
    if n < 2:
        return False
    i = 2
    while i <= math.sqrt(n):
        if n % i == 0:
            return False
        i += 1
    return True judge if n < 2:
        return False
     n < 2 n 2 return False False i = 2 i 2 while i <= math.sqrt(n):
        if n % i == 0:
            return False
        i += 1
     i <= math.sqrt(n) i math.sqrt(n) math.sqrt math sqrt n if n % i == 0:
            return False
         n % i == 0 n % i n i 0 return False False i += 1 i 1 return True True n n count = 0 count 0 n = int(input()) n int(input()) int input() input for i in range(n):
    if judge(int(input())):
        count += 1 i range(n) range n if judge(int(input())):
        count += 1 judge(int(input())) judge int(input()) int input() input count += 1 count 1 print(count) print count count = 0 0 count n = int(input()) int(input()) n count += 1 1 count def judge(n):
    if n < 2:
        return False
    i = 2
    while i <= math.sqrt(n):
        if n % i == 0:
            return False
        i += 1
    return True def judge(n):
    if n < 2:
        return False
    i = 2
    while i <= math.sqrt(n):
        if n % i == 0:
            return False
        i += 1
    return True judge
import math


def judge(n):
    if n < 2:
        return False
    i = 2
    while i <= math.sqrt(n):
        if n % i == 0:
            return False
        i += 1
    return True


count = 0
n = int(input())
for i in range(n):
    if judge(int(input())):
        count += 1
print(count)