N = int(eval(input()))

if N < 105:

    print((0))

elif N < 135:

    print((1))

elif N < 165:

    print((2))

elif N < 189:

    print((3))

elif N < 195:

    print((4))

else:

    print((5))
N = int(eval(input()))

def yaku(n):

    cnt = 0

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

        if n%k==0:

            cnt += 1

    return cnt



cnt = 0

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

    if n%2==1 and yaku(n)==8:

        if yaku(n)==8:

            cnt += 1



print(cnt)
N = int(eval(input()))
if N < 105:
    print((0))
elif N < 135:
    print((1))
elif N < 165:
    print((2))
elif N < 189:
    print((3))
elif N < 195:
    print((4))
else:
    print((5))

N = int(eval(input()))


def yaku(n):
    cnt = 0
    for k in range(1, n + 1):
        if n % k == 0:
            cnt += 1
    return cnt


cnt = 0
for n in range(1, N + 1):
    if n % 2 == 1 and yaku(n) == 8:
        if yaku(n) == 8:
            cnt += 1
print(cnt)

-if N < 105: -    print((0)) -elif N < 135: -    print((1)) -elif N < 165: -    print((2)) -elif N < 189: -    print((3)) -elif N < 195: -    print((4)) -else: -    print((5)) + + +def yaku(n): +    cnt = 0 +    for k in range(1, n + 1): +        if n % k == 0: +            cnt += 1 +    return cnt + + +cnt = 0 +for n in range(1, N + 1): +    if n % 2 == 1 and yaku(n) == 8: +        if yaku(n) == 8: +            cnt += 1 +print(cnt)