# N調べの時間を調べる c = input() l = len(c) k = 0 for n in range(1, 65536): k += len(bin(n)[2:]) if k == l: break print(n)