from collections import defaultdict

def f(n):

  dd=defaultdict(int)

  c=[2,3,5,7,11,13,17,19,23,29,31]

  i=0

  while i<11 and n//c[i]:

    while i<11 and n%c[i]==0:

      dd[c[i]]+=1

      n=n//c[i]

    i+=1

  r=1

  for i in list(dd.values()):

    r*=(i+1)

  return r



n=int(eval(input()))



l=[i for i in range(1,n+1,2)]

print((sum([1 for i in l if f(i)==8])))

from collections import defaultdict as dd

from functools import reduce

d=[2,3,5,7,11,13,17,19,23,29,31]

cd=len(d)



def f(n):

  i=0

  pr=dd(int)

  while i<cd and n//d[i]!=0:

    while i<cd and n%d[i]==0:

      pr[d[i]]+=1

      n=n//d[i]

    i+=1

  

  if list(pr.values()):

    return reduce(lambda x,y:x*y,[x+1 for x in list(pr.values())])

  else:

    return 0



n=int(eval(input()))

print((sum([1 for i in range(1,n+1,2) if f(i)==8])))
from collections import defaultdict


def f(n):
    dd = defaultdict(int)
    c = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]
    i = 0
    while i < 11 and n // c[i]:
        while i < 11 and n % c[i] == 0:
            dd[c[i]] += 1
            n = n // c[i]
        i += 1
    r = 1
    for i in list(dd.values()):
        r *= i + 1
    return r


n = int(eval(input()))
l = [i for i in range(1, n + 1, 2)]
print((sum([1 for i in l if f(i) == 8])))

from collections import defaultdict as dd
from functools import reduce

d = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31]
cd = len(d)


def f(n):
    i = 0
    pr = dd(int)
    while i < cd and n // d[i] != 0:
        while i < cd and n % d[i] == 0:
            pr[d[i]] += 1
            n = n // d[i]
        i += 1
    if list(pr.values()):
        return reduce(lambda x, y: x * y, [x + 1 for x in list(pr.values())])
    else:
        return 0


n = int(eval(input()))
print((sum([1 for i in range(1, n + 1, 2) if f(i) == 8])))

-from collections import defaultdict +from collections import defaultdict as dd +from functools import reduce + +d = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31] +cd = len(d) -    dd = defaultdict(int) -    c = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31] -    while i < 11 and n // c[i]: -        while i < 11 and n % c[i] == 0: -            dd[c[i]] += 1 -            n = n // c[i] +    pr = dd(int) +    while i < cd and n // d[i] != 0: +        while i < cd and n % d[i] == 0: +            pr[d[i]] += 1 +            n = n // d[i] -    r = 1 -    for i in list(dd.values()): -        r *= i + 1 -    return r +    if list(pr.values()): +        return reduce(lambda x, y: x * y, [x + 1 for x in list(pr.values())]) +    else: +        return 0 -l = [i for i in range(1, n + 1, 2)] -print((sum([1 for i in l if f(i) == 8]))) +print((sum([1 for i in range(1, n + 1, 2) if f(i) == 8])))