#include<iostream>
#include<cmath>
using namespace std;
int a,b,sum;
int main(){
cin>>a>>b;
if(abs(a)<abs(b)){
sum+=abs(a);
sum+=abs(a-b);
cout<<sum;
return 0;
}
else if(abs(a)>abs(b)){
sum+=abs(b);
sum+=abs(b-a);
cout<<sum;
return 0;
}
sum+=abs(a);
sum+=abs(a-b);
cout<<sum;
return 0;
}