#include using namespace std; using ll = long long; int main(){ int a, b; cin >> a >> b; ll ans = 1LL<<60; for(int i = 0;i <= min(a, b);++i){ for(int j = 0;j <= min(a, b);++j){ ll nat = i+j; ll unnat = (b-i) + (a-j); ans = min(ans, abs(nat - unnat)); } } cout << ans << endl; }