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