#include using namespace std; int main() { int a, b; cin >> a >> b; if(a == b) { cout << 0 << endl; return 0; } if(a < b) swap(a, b); int ans = 200; int c, d; for(int i = 0; i <= b; i++) { if(a - i < 0) continue; c = 2 * i; d = a + b - 2 * i; ans = min(ans, abs(c - d)); } cout << ans << endl; return 0; }