#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define INF_MIN 100000000 #define INF 1145141919 #define INF_MAX 2147483647 #define LL_MAX 9223372036854775807 #define EPS 1e-10 #define PI acos(-1) #define LL long long using namespace std; int x, y; int xx1, yy1; int main(){ cin >> x >> y; cin >> xx1 >> yy1; int ans = max(x, y); if(x == y && xx1 == yy1 && x*xx1 > 0 && y*yy1 > 0){ ans += 2; } cout << ans << endl; return 0; }