#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef long long int ll; //#include using namespace std; int main() { int Q; Q = 1; //cin >> Q; while (Q--) { int a, b; cin >> a >> b; int ans = a + b; for (int i = 0; i <= min(a, b); i++) { int d = i * 2; int x = a + b - d; ans = min(ans, abs(x - d)); } cout << ans << endl; } return 0; }