n = int(input())
count = 0
for i in range(n):
    x = int(input())
    if (x < 2):
        break
    if (x == 2):
        count += 1
    else:
        for j in range(2, n):
            if (x % j == 0):
                break
            else:
                count += 1
            j += 2
print(count)
 