#include <iostream>

// Run-time version.
// int times(int x, int y)
// {
//     if (x == 0) return 0;
//     if (x % 2) return y + 2 * times(x / 2, y);
//     return 2 * times(x / 2, y);
// }

template<long x, long y> struct times;
template<long x> struct times<x, 0> {
    static const long result = 0;
};
template<long x, long y> struct times {
    static const long result = 2 * times<x, y / 2>::result + x * (y % 2);
};

int main()
{
    std::cout << times<5000, 60000>::result << std::endl;
}
