# -*- coding: utf-8 -*- x = int(input()) number = 0 summation = 0 def solution(n, f): global number global summation if n < 2**31: if f == x: number += 1 summation += n solution(n*2, f) elif f < x: solution(n*2, f) solution(n*2+1, f+1) else: number = 1 summation = 0 solution(1, 1) print(number, summation)