#include <bits/stdc++.h> using namespace std; int main(){ int n,sum = 1; cin>>n; while(n == 0){ sum++; n /= 2; } cout<<sum * 4<<endl; return 0; }