#include #include #include #include using namespace std; typedef long long ll; int main() { ll x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; ll ans = max(x1, y1); if(abs(x1) == abs(y1) && abs(x1) > abs(x2) && x1*y2 - x2*y1 == 0) { ans++; } cout << ans << endl; }