N = int(eval(input()))



count = 0

for i in range(N):

    divisor_count = 0

    for j in range(i + 1):

        # 偶数は対象外

        if (j + 1) % 2 == 0:

            continue

        if (i + 1) % (j + 1) == 0:

            divisor_count += 1

    if divisor_count == 8:

        count += 1

print(count)

N = int(eval(input()))



ok_count = 0

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

    # 約数を8個もつものの数

    count = 0

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

        # print("{}".format(j))

        if i % j == 0:

            count += 1

    if count == 8:

        ok_count += 1

print(ok_count)

N = int(eval(input()))
count = 0
for i in range(N):
    divisor_count = 0
    for j in range(i + 1):
        # 偶数は対象外
        if (j + 1) % 2 == 0:
            continue
        if (i + 1) % (j + 1) == 0:
            divisor_count += 1
    if divisor_count == 8:
        count += 1
print(count)

N = int(eval(input()))
ok_count = 0
for i in range(1, N + 1, 2):
    # 約数を8個もつものの数
    count = 0
    for j in range(1, i + 1):
        # print("{}".format(j))
        if i % j == 0:
            count += 1
    if count == 8:
        ok_count += 1
print(ok_count)

-count = 0 -for i in range(N): -    divisor_count = 0 -    for j in range(i + 1): -        # 偶数は対象外 -        if (j + 1) % 2 == 0: -            continue -        if (i + 1) % (j + 1) == 0: -            divisor_count += 1 -    if divisor_count == 8: -        count += 1 -print(count) +ok_count = 0 +for i in range(1, N + 1, 2): +    # 約数を8個もつものの数 +    count = 0 +    for j in range(1, i + 1): +        # print("{}".format(j)) +        if i % j == 0: +            count += 1 +    if count == 8: +        ok_count += 1 +print(ok_count)