import math

def prime_numbers(x):
    i_a = list(range(2, x+1))
    p_a = list()
    e_a = math.sqrt(x)
    h = i_a[0]
    while h < e_a:
        h = i_a[0]
        p_a.append(h)
        for j in i_a:
            if j % h == 0:
                i_a.remove(j)
    p_a += i_a
    p_a.sort()
    return p_a

if __name__ == "__main__":
    n = int(input())
    n_s = list()
    for i in range(n):
        n_s.append(int(input()))

    pnums = prime_numbers(max(n_s))
    count = 0

    for i in n_s:
        if i in pnums:
            count += 1

    print(count)