#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define LL long long const long double eps = 1e6; int main(void){ LL x, y, a, b; cin >> x >> y >> a >> b; bool flag = false; auto d = sqrt((long double)x*x + y*y) - sqrt((long double)(x - a)*(x - a) + (y - b)*(y - b)) - (sqrt((long double)a*a + b*b)); if (d-eps)flag = true; if (x == 0 || y == 0)flag = false; if (abs(x) != abs(y))flag = false; cout << max(abs(x), abs(y)) + flag << endl; return(0); }