
#include <iostream>

using namespace std;
int get(int a, int b)
{
    if (a > b)return 2100000000;
    else return b - a;
}
int main()
{
    int a, b;
    cin >> a >> b;
    cout << min(min(get(a, b), get(-a, b) + 1), min(get(a, -b) + 1, get(-a, -b) + 2)) << endl;
    
    return 0;
}