#include #include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); uint32_t A[3], B; cin >> A[0] >> A[1] >> A[2] >> B; cout << max(A[0] + A[1] + B, A[2] << 1) + A[2] << '\n'; return 0; }