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 False
    l = x ** 0.5
    n = 2
    while n <= l:
        if x % n == 0:
            return False
        n += 1
    return True is_prime if x == 1:
        return False
     x == 1 x 1 return False False l = x ** 0.5 l x ** 0.5 x 0.5 n = 2 n 2 while n <= l:
        if x % n == 0:
            return False
        n += 1
     n <= l n l if x % n == 0:
            return False
         x % n == 0 x % n x n 0 return False False n += 1 n 1 return True True x x import sys 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 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:
        x = int(l)
        if is_prime(x):
            cnt += 1
     l file_input x = int(l) x int(l) int l if is_prime(x):
            cnt += 1
     is_prime(x) is_prime x cnt += 1 cnt 1 print(cnt) print cnt solve() 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 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 is_prime 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) 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 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()