#include using namespace std; int main() { int x, y, xx, yy; cin >> x >> y >> xx >> yy; cout << max(x, y) + (abs(x) == abs(y) && abs(xx) == abs(yy) && x * xx >= 0 && y * yy >= 0 && !(x == 0 && y == 0)); return 0; }