#include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); ll a, b, o, w; cin >> a >> b >> o >> w; ll ans = 0; cout << o + max(a, b) + w << endl; return 0; }