Solution to the problem number 167 of AceptaelReto - 167.

Any questions do not hesitate to contact.

#include <bits/stdc++.h>
using namespace std;
int main() {
    int l;
    while (cin >> l) {
        int s = 0, c = 1;
        while (l != 0) {
            s += c*l;
            l /= 2;
            c *= 4;
        }

        cout << 4*s << endl;
    }

    return 0;
}

Don't miss anything.

Keep in touch with Isaac Lozano Osorio!