from collections import deque x = int(input()) if x == 0: print(1, 0) exit() limit = 2**31 - 1 Que = deque([2 * (x - 1) + 1, 2 * x]) seen = set([2 * (x - 1) + 1, 2 * x]) ANS = [0, 0] while Que: cp = Que.popleft() ANS[0] += 1 ANS[1] += cp np = 2 * (cp - 1) + 1 if np not in seen and np <= limit: seen.add(np) Que.append(np) np = 2 * cp if np not in seen and np <= limit: seen.add(np) Que.append(np) print(*ANS)