#include #include #include using namespace std; int main() { int x, y, x2, y2; cin >> x >> y >> x2 >> y2; bool flag = true; if (x > 0)if (x2 < 0)flag = false; else if (x < 0)if (x2>0)flag = false; if (y>0)if (y2 < 0)flag = false; else if (y < 0) if (y2>0)flag = false; cout << max(abs(x),abs(y)) + (abs(x2)==abs(y2)&&abs(x)==abs(y)&&flag)<< endl; return 0; }