#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
int a,b,c,d;
int main()
{
    while(scanf("%d%d%d%d",&a,&b,&c,&d)!=EOF)
    {
        printf("%d\n",min(a,b)+min(c,d));
    }
    return 0;
}
