import math
import sys

def is_prime(x):
    if x == 1: return 0
    elif x == 2: return 1
    elif x % 2 == 0: return 0

    n = 3
    while n <= math.sqrt(x):
        if x % n == 0:
            return 0
        n += 2
    return 1

n = int(raw_input())
count = 0
for i in range(n):
    x = int(raw_input())
    count += is_prime(x)

print count import math math import sys sys def is_prime(x):
    if x == 1: return 0
    elif x == 2: return 1
    elif x % 2 == 0: return 0

    n = 3
    while n <= math.sqrt(x):
        if x % n == 0:
            return 0
        n += 2
    return 1 is_prime if x == 1: return 0
    elif x == 2: return 1
    elif x % 2 == 0: return 0

     x == 1 x 1 elif x == 2: return 1
     x == 2 x 2 elif x % 2 == 0: return 0

     x % 2 == 0 x % 2 x 2 0 n = 3 n 3 while n <= math.sqrt(x):
        if x % n == 0:
            return 0
        n += 2
     n <= math.sqrt(x) n math.sqrt(x) math.sqrt math sqrt x if x % n == 0:
            return 0
         x % n == 0 x % n x n 0 return 0 0 n += 2 n 2 return 1 1 x x n = int(raw_input()) n int(raw_input()) int raw_input() raw_input count = 0 count 0 for i in range(n):
    x = int(raw_input())
    count += is_prime(x) i range(n) range n x = int(raw_input()) x int(raw_input()) int raw_input() raw_input count += is_prime(x) count is_prime(x) is_prime x print def is_prime(x):
    if x == 1: return 0
    elif x == 2: return 1
    elif x % 2 == 0: return 0

    n = 3
    while n <= math.sqrt(x):
        if x % n == 0:
            return 0
        n += 2
    return 1 def is_prime(x):
    if x == 1: return 0
    elif x == 2: return 1
    elif x % 2 == 0: return 0

    n = 3
    while n <= math.sqrt(x):
        if x % n == 0:
            return 0
        n += 2
    return 1 is_prime n = int(raw_input()) int(raw_input()) n count += is_prime(x) is_prime(x) count x = int(raw_input()) int(raw_input()) x count = 0 0 count
import math
import sys

def is_prime(x):
    if x == 1: return 0
    elif x == 2: return 1
    elif x % 2 == 0: return 0

    n = 3
    while n <= math.sqrt(x):
        if x % n == 0:
            return 0
        n += 2
    return 1

n = int(raw_input())
count = 0
for i in range(n):
    x = int(raw_input())
    count += is_prime(x)

print count
