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 == 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 is_prime if x == 2:
        return 1
    elif x % 2 == 0:
        return 0
     x == 2 x 2 return 1 1 elif x % 2 == 0:
        return 0
     x % 2 == 0 x % 2 x 2 0 return 0 0 l = x ** 0.5 l x ** 0.5 x 0.5 for i in range(3, int(x ** 0.5) + 1, 2):
        if x % i == 0:
            return 0
     i range(3, int(x ** 0.5) + 1, 2) range 3 int(x ** 0.5) + 1 int(x ** 0.5) int x ** 0.5 x 0.5 1 2 if x % i == 0:
            return 0
     x % i == 0 x % i x i 0 return 0 0 return 1 1 x x import sys 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 file_input = sys.stdin file_input sys.stdin sys stdin N = file_input.readline() N file_input.readline() file_input.readline file_input readline cnt = 0 cnt 0 for l in file_input:
        cnt += is_prime(int(l))
     l file_input cnt += is_prime(int(l)) cnt is_prime(int(l)) is_prime int(l) int l print(cnt) print cnt solve() solve def solve():
    file_input = sys.stdin
    N = file_input.readline()
    cnt = 0
    for l in file_input:
        cnt += is_prime(int(l))
    print(cnt) 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 == 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 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 is_prime
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()