h = int(input()) l = [] n = 5 while n >= 0: l.append(h) h = h/2 n -= 1 print(l[0] + 2 * sum(l[1:5])) print(l[-1])