#include<stdio.h>
int main()
{
    int train_ordinary, train_unlimited, bus_ordinary, bus_unlimited, total;
    scanf("%d %d %d %d", &train_ordinary, &train_unlimited, &bus_ordinary, &bus_unlimited);
    if(train_ordinary>=train_unlimited && bus_ordinary>=bus_unlimited)
    {
        printf("%d",train_unlimited+bus_unlimited);
    }
    else if(train_ordinary>=train_unlimited && bus_ordinary<=bus_unlimited)
    {
        printf("%d",train_unlimited+bus_ordinary);
    }
    else if(train_ordinary<=train_unlimited && bus_ordinary>=bus_unlimited)
    {
        printf("%d",train_ordinary+bus_unlimited);
    }
    else if(train_ordinary<=train_unlimited && bus_ordinary<=bus_unlimited)
    {
        printf("%d",train_ordinary+bus_ordinary);
    }
    return 0;
}
