def IsPrime(n):
    '''

    :param n:??£??´??°
    :return: ?´???°?????????True, ????????????????????°?????????False
    ???????????§???????´???°??? 6k-1????????? 6k+1??§??¨?????????????????????k?????£??´??°
    '''
    if n == 2 or n == 3 or n== 5: return True
    if n == 1 or n%2 == 0 or n%3 == 0:return False
    d, l = 5, int(n**(1/2))
    while d <= l:
        if n%d == 0 or n%(d+2) == 0:return False
        d += 6
    return True
c = 0
for i in range(int(input())):
    if IsPrime(int(input())): c += 1
print(c) def IsPrime(n):
    '''

    :param n:??£??´??°
    :return: ?´???°?????????True, ????????????????????°?????????False
    ???????????§???????´???°??? 6k-1????????? 6k+1??§??¨?????????????????????k?????£??´??°
    '''
    if n == 2 or n == 3 or n== 5: return True
    if n == 1 or n%2 == 0 or n%3 == 0:return False
    d, l = 5, int(n**(1/2))
    while d <= l:
        if n%d == 0 or n%(d+2) == 0:return False
        d += 6
    return True IsPrime '''

    :param n:??£??´??°
    :return: ?´???°?????????True, ????????????????????°?????????False
    ???????????§???????´???°??? 6k-1????????? 6k+1??§??¨?????????????????????k?????£??´??°
    ''' if n == 2 or n == 3 or n== 5: return True
     n == 2 or n == 3 or n== 5 n == 2 or n == 3 n == 2 n 2 n == 3 n 3 n== 5 n 5 if n == 1 or n%2 == 0 or n%3 == 0:return False
     n == 1 or n%2 == 0 or n%3 == 0 n == 1 or n%2 == 0 n == 1 n 1 n%2 == 0 n%2 n 2 0 n%3 == 0 n%3 n 3 0 d, l = 5, int(n**(1/2)) d 5 l int(n**(1/2)) int n**(1/2) n 1/2 1 2 while d <= l:
        if n%d == 0 or n%(d+2) == 0:return False
        d += 6
     d <= l d l if n%d == 0 or n%(d+2) == 0:return False
         n%d == 0 or n%(d+2) == 0 n%d == 0 n%d n d 0 n%(d+2) == 0 n%(d+2) n d+2 d 2 0 d += 6 d 6 return True True n n c = 0 c 0 for i in range(int(input())):
    if IsPrime(int(input())): c += 1 i range(int(input())) range int(input()) int input() input if IsPrime(int(input())): c  IsPrime(int(input())) IsPrime int(input()) int input() input print(c) print c def IsPrime(n):
    '''

    :param n:??£??´??°
    :return: ?´???°?????????True, ????????????????????°?????????False
    ???????????§???????´???°??? 6k-1????????? 6k+1??§??¨?????????????????????k?????£??´??°
    '''
    if n == 2 or n == 3 or n== 5: return True
    if n == 1 or n%2 == 0 or n%3 == 0:return False
    d, l = 5, int(n**(1/2))
    while d <= l:
        if n%d == 0 or n%(d+2) == 0:return False
        d += 6
    return True def IsPrime(n):
    '''

    :param n:??£??´??°
    :return: ?´???°?????????True, ????????????????????°?????????False
    ???????????§???????´???°??? 6k-1????????? 6k+1??§??¨?????????????????????k?????£??´??°
    '''
    if n == 2 or n == 3 or n== 5: return True
    if n == 1 or n%2 == 0 or n%3 == 0:return False
    d, l = 5, int(n**(1/2))
    while d <= l:
        if n%d == 0 or n%(d+2) == 0:return False
        d += 6
    return True IsPrime c = 0 0 c
def IsPrime(n):
    '''

    :param n:??£??´??°
    :return: ?´???°?????????True, ????????????????????°?????????False
    ???????????§???????´???°??? 6k-1????????? 6k+1??§??¨?????????????????????k?????£??´??°
    '''
    if n == 2 or n == 3 or n== 5: return True
    if n == 1 or n%2 == 0 or n%3 == 0:return False
    d, l = 5, int(n**(1/2))
    while d <= l:
        if n%d == 0 or n%(d+2) == 0:return False
        d += 6
    return True
c = 0
for i in range(int(input())):
    if IsPrime(int(input())): c += 1
print(c)