import math

r = 100000000
sqrt = math.sqrt(r)
p = [1 for i in range(r)]
p[0] = 0
for i in range(1,sqrt):
    if p[i]:
        p[2*i+1::i+1] = [0 for x in range(2*i+1,r,i+1)]

count = 0
while True:
    try:
        n = int(raw_input())
        if p[n-1]:
            count += 1
print count