#include <cstdio>
#include <algorithm>
#include <iostream>
using namespace std;
int cmp(int a,int b,int c,int d)
{
    return min(a+d,b+c);
}
int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<cmp(a,b,c,d)<<endl;
}
