#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
int a2=abs(a),b2=abs(b);
int maxn=max(a2,b2),minn=min(a2,b2);
if(a>0&&b>0) cout<<max(a,b);
else if(a0&&b0) cout<<0;
else if(a<0&&b<0) cout<<maxn;
else cout<<minn*2+maxn;
}