N=int(eval(input()))

count = 0

count2 = 0

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

    #print(i,"i")

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

        #print(j,"k")

        if i % j == 0 :

            count += 1

            #print(count,"count")

    if count == 8 and i%2 != 0:

        count2 += 1

    ans = count2

    count = 0

print(ans)

N=int(eval(input()))

cnt = 0

ans = 0

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

    if i % 2 != 0:

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

            if i%j == 0:

                cnt += 1

                #print(j)

    if cnt == 8:

        ans += 1

    cnt = 0

print(ans)

N = int(eval(input()))
count = 0
count2 = 0
for i in range(1, N + 1):
    # print(i,"i")
    for j in range(1, N + 1):
        # print(j,"k")
        if i % j == 0:
            count += 1
            # print(count,"count")
    if count == 8 and i % 2 != 0:
        count2 += 1
    ans = count2
    count = 0
print(ans)

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

-count = 0 -count2 = 0 +cnt = 0 +ans = 0 -    # print(i,"i") -    for j in range(1, N + 1): -        # print(j,"k") -        if i % j == 0: -            count += 1 -            # print(count,"count") -    if count == 8 and i % 2 != 0: -        count2 += 1 -    ans = count2 -    count = 0 +    if i % 2 != 0: +        for j in range(1, i + 1): +            if i % j == 0: +                cnt += 1 +                # print(j) +    if cnt == 8: +        ans += 1 +    cnt = 0