#include using namespace std; int main() { int A, B, O, W; cin >> A >> B >> O >> W; int infect = 0; infect += O; if (A > B) infect += A; else infect += B; infect += W; cout << infect << endl; return 0; }