import math

def prime2(x):

    if x == 2: return True

    else:

        for s in stock:

            if x % s == 0: return False

        for j in range(3,int(math.sqrt(x))+1,2):

            if x % j == 0: return False

        else:

            stock.append(x)

            return True 

n = eval(input())

count = 0

stock = [2]

for i in range(n):

    if prime2(eval(input())): count += 1

print(count)
import math

def prime(x):

    if x == 2: return True

    elif x % 2 == 0: return False

    else:

        for j in range(3,int(math.sqrt(x))+1,2):

            if x % j == 0: return False

        else:

            return True 

n = eval(input())

count = 0

for i in range(n):

    if prime(eval(input())): count += 1

print(count)
import math


def prime2(x):
    if x == 2:
        return True
    else:
        for s in stock:
            if x % s == 0:
                return False
        for j in range(3, int(math.sqrt(x)) + 1, 2):
            if x % j == 0:
                return False
        else:
            stock.append(x)
            return True


n = eval(input())
count = 0
stock = [2]
for i in range(n):
    if prime2(eval(input())):
        count += 1
print(count)

import math


def prime(x):
    if x == 2:
        return True
    elif x % 2 == 0:
        return False
    else:
        for j in range(3, int(math.sqrt(x)) + 1, 2):
            if x % j == 0:
                return False
        else:
            return True


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

-def prime2(x): +def prime(x): +    elif x % 2 == 0: +        return False -        for s in stock: -            if x % s == 0: -                return False -            stock.append(x) -stock = [2] -    if prime2(eval(input())): +    if prime(eval(input())):