import collections



n = int(eval(input()))





def eratosthenes(n):

    sieve = [True for _ in range(n + 1)]

    sieve[0] = False

    sieve[1] = False



    def _update(p):

        if sieve[p]:

            for i in range(p * 2, n + 1, p):

                sieve[i] = False



    _update(2)

    p = 3

    while p * p <= n:

        _update(p)

        p += 2

    return sieve





sieve = eratosthenes(n)



res = 0

for k in range(1, n + 1, 2):

    counter = collections.Counter()

    for i in range(1, k):

        if sieve[i]:

            while k % i == 0:

                counter[i] += 1

                k //= i

    p = 1

    for v in list(counter.values()):

        p *= v + 1

    if p == 8:

        res += 1



print(res)
n = int(eval(input()))



res = 0

for k in range(1, n + 1, 2):

    count = 0

    for i in range(1, k + 1):

        if k % i == 0:

            count += 1

    if count == 8:

        res += 1



print(res)
import collections

n = int(eval(input()))


def eratosthenes(n):
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False

    _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


sieve = eratosthenes(n)
res = 0
for k in range(1, n + 1, 2):
    counter = collections.Counter()
    for i in range(1, k):
        if sieve[i]:
            while k % i == 0:
                counter[i] += 1
                k //= i
    p = 1
    for v in list(counter.values()):
        p *= v + 1
    if p == 8:
        res += 1
print(res)

n = int(eval(input()))
res = 0
for k in range(1, n + 1, 2):
    count = 0
    for i in range(1, k + 1):
        if k % i == 0:
            count += 1
    if count == 8:
        res += 1
print(res)

-import collections - - - -def eratosthenes(n): -    sieve = [True for _ in range(n + 1)] -    sieve[0] = False -    sieve[1] = False - -    def _update(p): -        if sieve[p]: -            for i in range(p * 2, n + 1, p): -                sieve[i] = False - -    _update(2) -    p = 3 -    while p * p <= n: -        _update(p) -        p += 2 -    return sieve - - -sieve = eratosthenes(n) -    counter = collections.Counter() -    for i in range(1, k): -        if sieve[i]: -            while k % i == 0: -                counter[i] += 1 -                k //= i -    p = 1 -    for v in list(counter.values()): -        p *= v + 1 -    if p == 8: +    count = 0 +    for i in range(1, k + 1): +        if k % i == 0: +            count += 1 +    if count == 8: