x = 10**8
plist = [True for _ in range(x)]
prime_list =[]
plist[0], plist[1] = False, False
for i in range(4, x, 2):
    plist[i] = False
for i in range(1, 10, 2):
    if plist[i] == True:
        for j in range(i*2, len(plist) + 1, i):
            if j >= len(plist):
                break
            plist[j] = False
for i in range(len(plist)):
    if plist[i] == True:
        prime_list.append(i)

def prime_number():
    n = int(input())
    count = 0
    for _ in range(n):
        if int(input()) in prime_list:
            count += 1
    print(count)


if __name__ == "__main__":
    prime_number()