#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int a,b; cin >> a >> b; cout << max(max(a,b)-min(a,b)-min(a,b)*2,(a+b)%2) << endl; }