#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
?´???°

?´???°??? 1 ??¨????????°??????????????§????????????????????¶??°????´???°??¨?¨?????????????
n ????????´??°???????????????????????????????????????????´???°?????°???????????????????????°????????????????????????????????????
"""
import math

def isPrime(x):
    """ ??¨???????????????????¢¨?´???°?????? """

    if x == 2: # ??¶??°??§?´???°??????????????°
        return True

    if x % 2 == 0: # 2??\????????¶??°????´???°??§?????????
        return False

    rx = int(math.sqrt(x)) + 1
    for i in range(3, rx, 2): # ?????????????????°?????????????????????
        if x % i == 0:
            return False
    return True


# ?????????
n = int(input().strip())
a = []
for i in range(n):
    a.append(int(input().strip()))
cnt = 0
for i in a:
    if isPrime(i) == True:
        cnt += 1

print(cnt) """
?´???°

?´???°??? 1 ??¨????????°??????????????§????????????????????¶??°????´???°??¨?¨?????????????
n ????????´??°???????????????????????????????????????????´???°?????°???????????????????????°????????????????????????????????????
""" import math math def isPrime(x):
    """ ??¨???????????????????¢¨?´???°?????? """

    if x == 2: # ??¶??°??§?´???°??????????????°
        return True

    if x % 2 == 0: # 2??\????????¶??°????´???°??§?????????
        return False

    rx = int(math.sqrt(x)) + 1
    for i in range(3, rx, 2): # ?????????????????°?????????????????????
        if x % i == 0:
            return False
    return True


# ????????? isPrime """ ??¨???????????????????¢¨?´???°?????? """ if x == 2: # ??¶??°??§?´???°??????????????°
        return True

     x == 2 x 2 return True True if x % 2 == 0: # 2??\????????¶??°????´???°??§?????????
        return False

     x % 2 == 0 x % 2 x 2 0 return False False rx = int(math.sqrt(x)) + 1 rx int(math.sqrt(x)) + 1 int(math.sqrt(x)) int math.sqrt(x) math.sqrt math sqrt x 1 for i in range(3, rx, 2): # ?????????????????°?????????????????????
        if x % i == 0:
            return False
     i range(3, rx, 2) range 3 rx 2 if x % i == 0:
            return False
     x % i == 0 x % i x i 0 return False False return True True x x n = int(input().strip()) n int(input().strip()) int input().strip() ().strip () input strip a = [] a [] for i in range(n):
    a.append(int(input().strip())) i range(n) range n a.append(int(input().strip())) a.append a append int(input().strip()) int input().strip() ().strip () input strip cnt = 0 cnt 0 for i in a:
    if isPrime(i) == True:
        cnt += 1 i a if isPrime(i) == True:
        cnt += 1 isPrime(i) == True isPrime(i) isPrime i True cnt += 1 cnt 1 print(cnt) print cnt n = int(input().strip()) int(input().strip()) n cnt = 0 0 cnt cnt += 1 1 cnt a = [] [] a def isPrime(x):
    """ ??¨???????????????????¢¨?´???°?????? """

    if x == 2: # ??¶??°??§?´???°??????????????°
        return True

    if x % 2 == 0: # 2??\????????¶??°????´???°??§?????????
        return False

    rx = int(math.sqrt(x)) + 1
    for i in range(3, rx, 2): # ?????????????????°?????????????????????
        if x % i == 0:
            return False
    return True


# ????????? def isPrime(x):
    """ ??¨???????????????????¢¨?´???°?????? """

    if x == 2: # ??¶??°??§?´???°??????????????°
        return True

    if x % 2 == 0: # 2??\????????¶??°????´???°??§?????????
        return False

    rx = int(math.sqrt(x)) + 1
    for i in range(3, rx, 2): # ?????????????????°?????????????????????
        if x % i == 0:
            return False
    return True


# ????????? isPrime
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
?´???°

?´???°??? 1 ??¨????????°??????????????§????????????????????¶??°????´???°??¨?¨?????????????
n ????????´??°???????????????????????????????????????????´???°?????°???????????????????????°????????????????????????????????????
"""
import math

def isPrime(x):
    """ ??¨???????????????????¢¨?´???°?????? """

    if x == 2: # ??¶??°??§?´???°??????????????°
        return True

    if x % 2 == 0: # 2??\????????¶??°????´???°??§?????????
        return False

    rx = int(math.sqrt(x)) + 1
    for i in range(3, rx, 2): # ?????????????????°?????????????????????
        if x % i == 0:
            return False
    return True


# ?????????
n = int(input().strip())
a = []
for i in range(n):
    a.append(int(input().strip()))
cnt = 0
for i in a:
    if isPrime(i) == True:
        cnt += 1

print(cnt)