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