n = int(input()) fel = [3, 5, 17, 257, 65537] res = 0 i = 0 while 2 ** i <= n: num = 2 ** i for j in range(32): t = 1 while t <= 31: if j & t > 0: idx = str(bin(t))[::-1].index("1") num *= fel[idx] t <<= 1 if 3 <= num <= n: res += 1 num = 2 ** i i += 1 print(res)