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(input())
    cnt = 0
    for i in range(N):
        cnt += is_prime(int(input()))
    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 is_prime if x == 1:
        return 0
     x == 1 x 1 return 0 0 l = x ** 0.5 l x ** 0.5 x 0.5 n = 2 n 2 while n <= l:
        if x % n == 0:
            return 0
        n += 1
     n <= l n l if x % n == 0:
            return 0
         x % n == 0 x % n x n 0 return 0 0 n += 1 n 1 return 1 1 x x import sys sys def solve():
    N = int(input())
    cnt = 0
    for i in range(N):
        cnt += is_prime(int(input()))
    print(cnt) solve N = int(input()) N int(input()) int input() input cnt = 0 cnt 0 for i in range(N):
        cnt += is_prime(int(input()))
     i range(N) range N cnt += is_prime(int(input())) cnt is_prime(int(input())) is_prime int(input()) int input() input print(cnt) print cnt solve() 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 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 is_prime def solve():
    N = int(input())
    cnt = 0
    for i in range(N):
        cnt += is_prime(int(input()))
    print(cnt) def solve():
    N = int(input())
    cnt = 0
    for i in range(N):
        cnt += is_prime(int(input()))
    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(input())
    cnt = 0
    for i in range(N):
        cnt += is_prime(int(input()))
    print(cnt)

solve()