n = int(eval(input()))



ans = 0

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

    if i%2 == 0:

        continue

    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,2):

    cnt = 0

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

        if j>i:

            break

        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):
    if i % 2 == 0:
        continue
    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, 2):
    cnt = 0
    for j in range(1, n + 1, 2):
        if j > i:
            break
        if i % j == 0:
            cnt += 1
    if cnt == 8:
        ans += 1
print(ans)

-for i in range(1, n + 1): -    if i % 2 == 0: -        continue +for i in range(1, n + 1, 2): -    for j in range(1, i + 1): +    for j in range(1, n + 1, 2): +        if j > i: +            break