#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    int a,b,c,d,t,t2;
    while(~scanf("%d %d %d %d",&a,&b,&c,&d))
    {
        if(a<=b)
            t=a;
        else
            t=b;

        if(c<=d)
            t2=c;
        else
            t2=d;
        printf("%d\n",t+t2);
    }

    return 0;
}

