#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 -= 2; unmatched += 2; d = min(d, abs(matched - unmatched)); } cout << d << endl; }