n = int(eval(input()))

r = 0



for i in range(0, n, 2):

    c = 0



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

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

            c += 1



    if c == 8:

        r += 1



print(r)

n = int(eval(input()))

r = 0



for i in range(0, n, 2):

    c = 1



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

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

            c += 1



    if c == 8:

        r += 1



print(r)

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

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

-    c = 0 -    for j in range(0, i + 1, 2): +    c = 1 +    for j in range(2, i + 1, 2):