c = int(eval(input()))

b = 0

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

    a = 0

    for j in range(1, c + 1):

        if i % j == 0:

            a += 1

    if a == 8:

        b += 1

print(b)

a = int(eval(input()))

c = 0

for i in range(a + 1):

    if i % 2 == 1:

        b = 0

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

            if i % j == 0:

                b += 1

        if b == 8:

            c += 1

print(c)

c = int(eval(input()))
b = 0
for i in range(1, c + 1, 2):
    a = 0
    for j in range(1, c + 1):
        if i % j == 0:
            a += 1
    if a == 8:
        b += 1
print(b)

a = int(eval(input()))
c = 0
for i in range(a + 1):
    if i % 2 == 1:
        b = 0
        for j in range(1, i + 1):
            if i % j == 0:
                b += 1
        if b == 8:
            c += 1
print(c)

-c = int(eval(input())) -b = 0 -for i in range(1, c + 1, 2): -    a = 0 -    for j in range(1, c + 1): -        if i % j == 0: -            a += 1 -    if a == 8: -        b += 1 -print(b) +a = int(eval(input())) +c = 0 +for i in range(a + 1): +    if i % 2 == 1: +        b = 0 +        for j in range(1, i + 1): +            if i % j == 0: +                b += 1 +        if b == 8: +            c += 1 +print(c)