#include using namespace std; #include using namespace atcoder; using ll = long long; #define all(x) (x).begin(), (x).end() template ostream &operator<<(ostream &os, const pair &p) { os << p.first << ' ' << p.second; return os; } template istream &operator>>(istream &is, pair &p) { is >> p.first >> p.second; return is; } template ostream &operator<<(ostream &os, const vector &v) { ll s = (ll)v.size(); for (ll i = 0; i < s; i++) os << (i ? ' ' : ' ') << v[i]; return os; } template istream &operator>>(istream &is, vector &v) { for (auto &x : v) is >> x; return is; } //エラトステネスのふるい bool IsPrime(ll num) { if (num < 2) return false; else if (num == 2) return true; else if (num % 2 == 0) return false; // 偶数はあらかじめ除く double sqrtNum = sqrt(num); for (int i = 3; i <= sqrtNum; i += 2) { if (num % i == 0) { // 素数ではない return false; } } // 素数である return true; } #define rep(i, n) for (ll (i) = 0; (i) < (ll)(n); (i)++) int main() { ll a,b,o,ab; cin >> a >> b >> o >> ab; cout << o+max(a,b)+ab << endl; }