from math import sqrt

def f(n):
    if n == 2:
        return 1

    if n % 2 == 0:
        return 0

    for i in range(3, round(sqrt(n)+1), 2):
        if n % i == 0:
            return 0
    else:
        return 1

def g(n):
    d = {}
    for _ in range(n):
        i = int(input())
        if not (i in d):
            d[i] = f(i)
        yield d[i]

n = int(input())
print(sum(g(n))) from math import sqrt def f(n):
    if n == 2:
        return 1

    if n % 2 == 0:
        return 0

    for i in range(3, round(sqrt(n)+1), 2):
        if n % i == 0:
            return 0
    else:
        return 1 f if n == 2:
        return 1

     n == 2 n 2 return 1 1 if n % 2 == 0:
        return 0

     n % 2 == 0 n % 2 n 2 0 return 0 0 for i in range(3, round(sqrt(n)+1), 2):
        if n % i == 0:
            return 0
    else:
        return 1 i range(3, round(sqrt(n)+1), 2) range 3 round(sqrt(n)+1) round sqrt(n)+1 sqrt(n) sqrt n 1 2 if n % i == 0:
            return 0
     n % i == 0 n % i n i 0 return 0 0 return 1 1 n n def g(n):
    d = {}
    for _ in range(n):
        i = int(input())
        if not (i in d):
            d[i] = f(i)
        yield d[i] g d = {} d {} for _ in range(n):
        i = int(input())
        if not (i in d):
            d[i] = f(i)
        yield d[i] _ range(n) range n i = int(input()) i int(input()) int input() input if not (i in d):
            d[i] = f(i)
         not (i in d) i in d i d d[i] = f(i) d[i] d i f(i) f i yield d[i] d[i] d i n n n = int(input()) n int(input()) int input() input print(sum(g(n))) print sum(g(n)) sum g(n) g n def g(n):
    d = {}
    for _ in range(n):
        i = int(input())
        if not (i in d):
            d[i] = f(i)
        yield d[i] def g(n):
    d = {}
    for _ in range(n):
        i = int(input())
        if not (i in d):
            d[i] = f(i)
        yield d[i] g n = int(input()) int(input()) n def f(n):
    if n == 2:
        return 1

    if n % 2 == 0:
        return 0

    for i in range(3, round(sqrt(n)+1), 2):
        if n % i == 0:
            return 0
    else:
        return 1 def f(n):
    if n == 2:
        return 1

    if n % 2 == 0:
        return 0

    for i in range(3, round(sqrt(n)+1), 2):
        if n % i == 0:
            return 0
    else:
        return 1 f
from math import sqrt

def f(n):
    if n == 2:
        return 1

    if n % 2 == 0:
        return 0

    for i in range(3, round(sqrt(n)+1), 2):
        if n % i == 0:
            return 0
    else:
        return 1

def g(n):
    d = {}
    for _ in range(n):
        i = int(input())
        if not (i in d):
            d[i] = f(i)
        yield d[i]

n = int(input())
print(sum(g(n)))