import math
A = []
N = int(input())
count = 0
for n in range(N):
    x = int(input())
    if x == 2:
        A.append(x)
        count += 1
    elif x % 2 == 0:
        pass
    elif x > 2:
        for i in range(3, int(math.sqrt(x))+2, 2):
            if x % i == 0:
                break
        else:
            count += 1
            A.append(x)
    
print(count) import math math A = [] A [] N = int(input()) N int(input()) int input() input count = 0 count 0 for n in range(N):
    x = int(input())
    if x == 2:
        A.append(x)
        count += 1
    elif x % 2 == 0:
        pass
    elif x > 2:
        for i in range(3, int(math.sqrt(x))+2, 2):
            if x % i == 0:
                break
        else:
            count += 1
            A.append(x)
     n range(N) range N x = int(input()) x int(input()) int input() input if x == 2:
        A.append(x)
        count += 1
    elif x % 2 == 0:
        pass
    elif x > 2:
        for i in range(3, int(math.sqrt(x))+2, 2):
            if x % i == 0:
                break
        else:
            count += 1
            A.append(x)
     x == 2 x 2 A.append(x) A.append A append x count += 1 count 1 elif x % 2 == 0:
        pass
     x % 2 == 0 x % 2 x 2 0 elif x > 2:
        for i in range(3, int(math.sqrt(x))+2, 2):
            if x % i == 0:
                break
        else:
            count += 1
            A.append(x)
     x > 2 x 2 for i in range(3, int(math.sqrt(x))+2, 2):
            if x % i == 0:
                break
        else:
            count += 1
            A.append(x)
     i range(3, int(math.sqrt(x))+2, 2) range 3 int(math.sqrt(x))+2 int(math.sqrt(x)) int math.sqrt(x) math.sqrt math sqrt x 2 2 if x % i == 0:
                break
         x % i == 0 x % i x i 0 break count += 1 count 1 A.append(x) A.append A append x print(count) print count count += 1 1 count count += 1 1 count count = 0 0 count x = int(input()) int(input()) x N = int(input()) int(input()) N A = [] [] A
import math
A = []
N = int(input())
count = 0
for n in range(N):
    x = int(input())
    if x == 2:
        A.append(x)
        count += 1
    elif x % 2 == 0:
        pass
    elif x > 2:
        for i in range(3, int(math.sqrt(x))+2, 2):
            if x % i == 0:
                break
        else:
            count += 1
            A.append(x)
    
print(count)