from math import sqrt

N=int(eval(input()))

ans=0

for i in range(1,N+1,2):

  d=[]

  for j in range(1,int(sqrt(i))+1):

    if i%j==0:

      d.append(j)

      d.append(N//j)

  d=list(set(d))

  if len(d)==8:

    ans+=1

print(ans)
N=int(eval(input()))

ans=0

for i in range(1,N+1,2):

  cnt=2

  for j in range(3,int(i**0.5)+1,2):

    if i%j==0:

      cnt+=2

  if cnt==8:

    ans+=1

print(ans)
from math import sqrt

N = int(eval(input()))
ans = 0
for i in range(1, N + 1, 2):
    d = []
    for j in range(1, int(sqrt(i)) + 1):
        if i % j == 0:
            d.append(j)
            d.append(N // j)
    d = list(set(d))
    if len(d) == 8:
        ans += 1
print(ans)

N = int(eval(input()))
ans = 0
for i in range(1, N + 1, 2):
    cnt = 2
    for j in range(3, int(i**0.5) + 1, 2):
        if i % j == 0:
            cnt += 2
    if cnt == 8:
        ans += 1
print(ans)

-from math import sqrt - -    d = [] -    for j in range(1, int(sqrt(i)) + 1): +    cnt = 2 +    for j in range(3, int(i**0.5) + 1, 2): -            d.append(j) -            d.append(N // j) -    d = list(set(d)) -    if len(d) == 8: +            cnt += 2 +    if cnt == 8: