#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int a,b,o,w; cin>>a>>b>>o>>w; int ma=0; if(o && a) ma=max(ma,o+a+w); if(o && b) ma=max(ma,o+b+w); if(o) ma=max(ma,o+w); if(a) ma=max(ma,a+w); if(b) ma=max(ma,b+w); ma=max(ma,w); cout<