#include using namespace std; int main(){ int a,b;cin>>a>>b; if(abs(a-b) <= 2*min(a,b))cout << abs(a-b)%2 << endl; else cout << abs(a-b)-2*min(a,b) << endl; }