N = int(input()) A = [] for n in range(5+1): a = pow(2,pow(2,n))+1 flag = True for i in range(2,a+1): if i*i>a:break if a%i==0: flag = False if flag: A.append(a) ans = 0 for m in range(31): x = pow(2,m) for i in range(1<>k)&1: cnt *= A[k] if x*cnt<=N: ans += 1 print(ans-2)