def is_prime(x):

    if x == 1:

        return 0

    l = x ** 0.5

    n = 2

    while n <= l:

        if x % n == 0:

            return 0

        n += 1

    return 1



import sys



def solve():

    N = int(eval(input()))

    cnt = 0

    for i in range(N):

        cnt += is_prime(int(eval(input())))

    print(cnt)



solve()
def is_prime(x):

    if x == 2:

        return 1

    elif x % 2 == 0:

        return 0

    l = x ** 0.5

    for i in range(3, int(x ** 0.5) + 1, 2):

        if x % i == 0:

            return 0

    return 1



import sys



def solve():

    file_input = sys.stdin

    N = file_input.readline()

    cnt = 0

    for l in file_input:

        cnt += is_prime(int(l))

    print(cnt)



solve()
def is_prime(x):
    if x == 1:
        return 0
    l = x**0.5
    n = 2
    while n <= l:
        if x % n == 0:
            return 0
        n += 1
    return 1


import sys


def solve():
    N = int(eval(input()))
    cnt = 0
    for i in range(N):
        cnt += is_prime(int(eval(input())))
    print(cnt)


solve()

def is_prime(x):
    if x == 2:
        return 1
    elif x % 2 == 0:
        return 0
    l = x**0.5
    for i in range(3, int(x**0.5) + 1, 2):
        if x % i == 0:
            return 0
    return 1


import sys


def solve():
    file_input = sys.stdin
    N = file_input.readline()
    cnt = 0
    for l in file_input:
        cnt += is_prime(int(l))
    print(cnt)


solve()

-    if x == 1: +    if x == 2: +        return 1 +    elif x % 2 == 0: -    n = 2 -    while n <= l: -        if x % n == 0: +    for i in range(3, int(x**0.5) + 1, 2): +        if x % i == 0: -        n += 1 -    N = int(eval(input())) +    file_input = sys.stdin +    N = file_input.readline() -    for i in range(N): -        cnt += is_prime(int(eval(input()))) +    for l in file_input: +        cnt += is_prime(int(l))