#include<stdio.h>
int main()
{
    int train_ordinary, train_unlimited, bus_ordinary, bus_unlimited, total;
    scanf("%d\n%d\n%d\n%d", &train_ordinary, &train_unlimited, &bus_ordinary, &bus_unlimited);
    if(train_ordinary <= train_unlimited)
    {

        if(bus_ordinary <= bus_unlimited)
        {
            total = train_ordinary + bus_ordinary;
        }
        else
        {
            total = train_ordinary + bus_unlimited;
        }
    }
    else
    {
        if(bus_ordinary <= bus_unlimited)
        {
            total = train_unlimited + bus_ordinary;
        }
        else
        {
            total = train_unlimited + bus_unlimited;
        }
    }
    printf("%d\n", total);
    return 0;
}
