def make_divisors(n):

    divisors = []

    for i in range(1, int(n**0.5)+1):

        if n % i == 0:

            divisors.append(i)

            if i != n // i:

                divisors.append(n//i)



    divisors.sort()

    return divisors

n=int(eval(input()))

if n<105:

    print((0))

    exit()

ans=1

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

    if i%2==0:

        continue

    l=make_divisors(i)

    if len(l)==8:

        ans+=1

print(ans)

n=int(eval(input()))

if n<105:

    print((0))

    exit()

ans=0

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

    c=0

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

        if i%j==0:

            c+=1

    if c==8:

        ans+=1

print(ans)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    divisors.sort()
    return divisors


n = int(eval(input()))
if n < 105:
    print((0))
    exit()
ans = 1
for i in range(106, n + 1):
    if i % 2 == 0:
        continue
    l = make_divisors(i)
    if len(l) == 8:
        ans += 1
print(ans)

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

-def make_divisors(n): -    divisors = [] -    for i in range(1, int(n**0.5) + 1): -        if n % i == 0: -            divisors.append(i) -            if i != n // i: -                divisors.append(n // i) -    divisors.sort() -    return divisors - - -ans = 1 -for i in range(106, n + 1): -    if i % 2 == 0: -        continue -    l = make_divisors(i) -    if len(l) == 8: +ans = 0 +for i in range(105, n + 1, 2): +    c = 0 +    for j in range(1, i + 1): +        if i % j == 0: +            c += 1 +    if c == 8: