#include<bits/stdc++.h>
int main()
{
    int a,b,c,d,k,l;
    scanf("%d %d %d %d",&a,&b,&c,&d);
    if(a<=b){
        k=a;
    }
    else
        k=b;
    if(c<=d){
        l=c;
    }
    else
        l=d;
    printf("%d",k+l);
    return 0;

}
