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