#include "iostream" using namespace std; const long long int UP = 2147483647; long long int log_num[32] = { 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435356,536870912,1073741824,2147483648 }; int N; long long int ans; int fig; void search(long long int num,int point ,int cap) { if (num > UP)return ; if (num == 0) { search(1, 1,30); if (N == 0) { fig++; } return ; } if (point < N) { if(cap-1+point>=N)search(num * 2, point,cap-1); if(cap+point)search(num * 2 + 1, point + 1,cap-1); } else if (point == N) { /*for (int i = cap; i >= 0; i--) { ans += num; num *= 2; }*/ ans += num*log_num[cap] * 2 - num; fig+=cap+1; } return ; } int main() { cin >> N; search(0, 0,31); cout << fig << " " << ans << "\n"; return 0; }