#include "cstdio"
int xxx(int x,int y)
{
    if(x<=y) return y-x;
        else return x-y+2;
} 
int min(int x,int y){
	return x<y?x:y;
}
int x,y;
int main(){
	scanf("%d%d",&x,&y);
	printf("%d",min(xxx(x,y),min(xxx(-x,y)+1,min(xxx(x,-y)+1,xxx(-x,-y)+2))));
}