#coding:UTF-8
import math
def Count(x):
    if x == 2:
        return 1
    if x<2 or x%2==0:
        return 0
    i=3
    while i<=math.sqrt(x):
        if x%i==0:
            return 0
        i+=2
    return 1

def PN(n,a):
    count=0
    for i in range(n):
        count+=Count(a[i])
    print(count)
    
if __name__=="__main__":
    n=int(input())
    a=[]
    for i in range(n):
        a.append(int(input()))
    PN(n,a) import math math def Count(x):
    if x == 2:
        return 1
    if x<2 or x%2==0:
        return 0
    i=3
    while i<=math.sqrt(x):
        if x%i==0:
            return 0
        i+=2
    return 1 Count if x == 2:
        return 1
     x == 2 x 2 return 1 1 if x<2 or x%2==0:
        return 0
     x<2 or x%2==0 x<2 x 2 x%2==0 x%2 x 2 0 return 0 0 i=3 i 3 while i<=math.sqrt(x):
        if x%i==0:
            return 0
        i+=2
     i<=math.sqrt(x) i math.sqrt(x) math.sqrt math sqrt x if x%i==0:
            return 0
         x%i==0 x%i x i 0 return 0 0 i+=2 i 2 return 1 1 x x def PN(n,a):
    count=0
    for i in range(n):
        count+=Count(a[i])
    print(count)
     PN count=0 count 0 for i in range(n):
        count+=Count(a[i])
     i range(n) range n count+=Count(a[i]) count Count(a[i]) Count a[i] a i print(count) print count n n a a if __name__=="__main__":
    n=int(input())
    a=[]
    for i in range(n):
        a.append(int(input()))
    PN(n,a) __name__=="__main__" __name__ "__main__" n=int(input()) n int(input()) int input() input a=[] a [] for i in range(n):
        a.append(int(input()))
     i range(n) range n a.append(int(input())) a.append a append int(input()) int input() input PN(n,a) PN n a n=int(input()) int(input()) n a=[] [] a def PN(n,a):
    count=0
    for i in range(n):
        count+=Count(a[i])
    print(count)
     def PN(n,a):
    count=0
    for i in range(n):
        count+=Count(a[i])
    print(count)
     PN def Count(x):
    if x == 2:
        return 1
    if x<2 or x%2==0:
        return 0
    i=3
    while i<=math.sqrt(x):
        if x%i==0:
            return 0
        i+=2
    return 1 def Count(x):
    if x == 2:
        return 1
    if x<2 or x%2==0:
        return 0
    i=3
    while i<=math.sqrt(x):
        if x%i==0:
            return 0
        i+=2
    return 1 Count
#coding:UTF-8
import math
def Count(x):
    if x == 2:
        return 1
    if x<2 or x%2==0:
        return 0
    i=3
    while i<=math.sqrt(x):
        if x%i==0:
            return 0
        i+=2
    return 1

def PN(n,a):
    count=0
    for i in range(n):
        count+=Count(a[i])
    print(count)
    
if __name__=="__main__":
    n=int(input())
    a=[]
    for i in range(n):
        a.append(int(input()))
    PN(n,a)