#include<bits/stdc++.h>
using namespace std;

int main(){
    long long x,y; cin >> x >> y;
    long long ans=1e11;
    if(-x<=y){
        ans=min(y+x+1,ans);
    }
    if(x<=y){
        ans=min(y-x,ans);
    }
    if(x<=-y){
        ans=min(-y-x+1,ans);
    }
    if(-x<=-y){
        ans=min(-y+x+2,ans);
    }
    cout << ans << endl;
}