n = int(eval(input()))

ans = 0



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

    count = 0

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

        if i % 2 == 0:

            break

        if i % j == 0:

            count += 1

    if count == 8:

        ans += 1

        

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

ans = 0

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

    if i % 2 == 1:

        cnt = 0

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

            if i % j == 0:

                cnt += 1

        if cnt == 8:

            ans += 1

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

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

-    count = 0 -    for j in range(1, n + 1): -        if i % 2 == 0: -            break -        if i % j == 0: -            count += 1 -    if count == 8: -        ans += 1 +    if i % 2 == 1: +        cnt = 0 +        for j in range(1, i + 1): +            if i % j == 0: +                cnt += 1 +        if cnt == 8: +            ans += 1