#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){
    int a;
    int b;
    cin >> a >> b;
    int tmp = (2 * (a) + 100);
    cout << tmp - b << endl;
    return 0;
}
#include <algorithm>
#include <array>
#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
#include <vector>

using namespace std;
#define int long long
#define ll long long
#define INF 1LL << 33
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define SHOW(p) \
    if (test)   \
        cout << #p " : " << p << endl;
bool test = true;
//bool test = false;
int B, C, n, ans;
signed main()
{
    cin >> B >> C;
    n = C / 2;
    if (C == 1) {
        if (B == 0) {
            ans = 1;
        } else {
            ans = 2;
        }
    } else if (C == 2) {
        if (B == 0) {
            ans = 2;
        } else {
            ans = 3;
        }
    } else if (B == 0) {
        if (C % 2 == 0) {
            ans = 2 * n;
        } else {
            ans = 2 * n + 1;
        }
    } else if (B > 0) {
        if (C % 2 == 0) {
            if (B - n > 0) {
                // |X| <= B
                ans = 2 * n + 1;
            } else {
                // |X| <= B
                ans = 2 * B + 1;
            }
            // |X| > B
            ans += 2 * n - 2;
        } else {
            if (B - n > 0) {
                // |X| <= B
                ans = 2 * n + 2;
            } else {
                // |X| <= B
                ans = 2 * B + 1;
            }
            // |X| > B
            ans += 2 * n - 1;
        }
    } else {
        if (C % 2 == 0) {
            // |X| <= B
            if (B + n >= 0) {
                ans = -2 * B + 1;
            } else {
                ans = 2 * n + 1;
            }
            // |X| > B
            ans += 2 * n - 1;
        } else {
            // |X| <= B
            if (B + n >= 0) {
                ans = -2 * B + 1;
            } else {
                ans = 2 * n;
            }
            ans += 2 * n;
        }
    }
    cout << ans << endl;
    return 0;
}
