#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; bool rcmp(int a, int b) { return a>b; } typedef long long LL; int main() { int n, i, a, b, c1, c2; int r; scanf("%d %d", &a, &b); c1=min(a, b)*2; c2 = a+b-c1; r=abs(c1-c2); while(c1>c2) { r=min(r, c1-c2); c1-=2; c2+=2; } r=min(r, abs(c1-c2)); printf("%d\n", r); return 0; }