#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main(){ ll A, B, ans=1e5; cin >> A >> B; for (int i=0; i<=A; i++){ ans = min(ans, abs(B-A+2*i-2*(A-i))); } cout << ans << endl; return 0; }