#include using namespace std; int main() { int A, B, O, W; cin >> A >> B >> O >> W; cout << O + W + max(A, B) << endl; }