#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;
    }
}

#include<stdio.h>
int main()
{
    int A, B, C, D, X, Y;
    scanf("%d%d%d%d",&A, &B, &C, &D);
    if(A>B){X=B;}
       else{
        X = A;
    }
    if (C>D){Y=D;}
        else {
        Y = C;
    }
    printf("%d\n", (X+Y) );

    return 0;

}
