#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 = abs(matched - unmatched); for (int i = 0; i < min(a, b); i++) { matched--; unmatched++; d = min(d, abs(matched - unmatched)); } cout << d << endl; }