#include #include using namespace std; using namespace atcoder; using ll = long long; void fast_io() { cin.tie(nullptr); ios_base::sync_with_stdio(false); } int main(void) { fast_io(); ll a, b; cin >> a >> b; ll m = min(a, b); ll ans = 2e18; for (int i = 0; i < m; i++) { ans = min(ans, abs(2 * i - (a + b - 2 * i))); } cout << ans << endl; return 0; }