def is_prime(x):

    if x == 1:

        return False

    l = x ** 0.5

    n = 2

    while n <= l:

        if x % n == 0:

            return False

        n += 1

    return True



import sys



def solve():

    file_input = sys.stdin

    N = file_input.readline()

    cnt = 0

    for l in file_input:

        x = int(l)

        if is_prime(x):

            cnt += 1

    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 == 1:
        return False
    l = x**0.5
    n = 2
    while n <= l:
        if x % n == 0:
            return False
        n += 1
    return True


import sys


def solve():
    file_input = sys.stdin
    N = file_input.readline()
    cnt = 0
    for l in file_input:
        x = int(l)
        if is_prime(x):
            cnt += 1
    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()

-        return False +        return 0 -            return False +            return 0 -    return True +    return 1 -    file_input = sys.stdin -    N = file_input.readline() +    N = int(eval(input())) -    for l in file_input: -        x = int(l) -        if is_prime(x): -            cnt += 1 +    for i in range(N): +        cnt += is_prime(int(eval(input())))