import bisect
target=50000000
d=[0]*target
n=2
while n < target:
for i in range(n*n,target,n):
d[i]=d[i]+1
n=n+1
while n < target and d[n]>0:
n=n+1
p=[k for k in range(2,target) if d[k]==0]
z=10**8
r=0
for i,j in enumerate(p):
k=z/j
if k>j:
r+=bisect.bisect(p,k)-i
else:
break
print r