#include #include using namespace std; using namespace atcoder; using ll = int_fast64_t; using ull = uint_fast64_t; using mint = modint998244353; constexpr ll INF = 1ll << 60; #define iscontain(container, value) (find(container.begin(), container.end(), value) != container.end()) template void printelem(const T& container, const D& divide){ for(const auto& i : container) cout << i << divide; cout << endl; } template void printelem(const T& container) { printelem(container, ", "); } template T input(){ T ret; cin >> ret; return ret; } int main(){ //インプット ll H, A; cin >> H >> A; ll ans = 0; for(ll i = 1; H > 0; i *= 2){ ans += i; H /= 2; } //アウトプット cout << ans; return 0; }