#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a <= b && c <= d) {
        cout << a + c << "\n";
    } else if (a <= b && c >= d) {
        cout << a + d << "\n";
    } else if (a >= b && c >= d) {
        cout << b + d << "\n";
    } else if (a >= b && c <= d) {
        cout << b + c << "\n";
    }


}














#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d,ans;
    while(cin >> a >> b >> c >> d){
        ans = 0;
        ans+=min(a,b);
        ans+=min(c,d);
        cout << ans << endl;
    }
}
