#include using namespace std; int main(){ int a, b; cin >> a >> b; int ans = 1e9; for(int i = 0; i <= a + b; i += 2){ ans = min(ans, abs(a + b - 2 * i)); } cout << ans << endl; }