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