#include using namespace std; #include using namespace atcoder; using ll = long long; using ld = long double; #ifdef LOCAL #include #else #define dump(...) void(0) #endif using mint = modint998244353; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int A, B, O, W; cin >> A >> B >> O >> W; int ans = max(O + A + W, O + B + W); cout << ans << endl; }