#include using namespace std; int main(void){ int a, b; cin >> a >> b; int matched = min(a, b) * 2; int unmatched = (a +b ) - matched; int d = matched - unmatched; while (!(d <= 0 || matched == 0)) { matched--; unmatched++; d = matched - unmatched; } cout << abs(d) << endl; }