#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef unsigned long long ull; typedef long long ll; #define REP(i,n) for(int (i) = 0; (i) < (n); ++(i)) #define FOR(i,a,b) for(int (i) = a; (i) < (b); ++(i)) int main () { int a, b, o, w; cin >> a >> b >> o >> w; cout << o + max(a,b) + w << endl; }