import std.stdio, std.algorithm, std.string, std.conv, std.array, std.range, std.math;
int readint() { return readln.chomp.to!int; }
int[] readints() { return readln.split.to!(int[]); }


void main() {
    int a,b,c,d;
    readf("%d\n%d\n%d\n%d\n", &a, &b, &c, &d);
    writeln(min(a,b) + min(c,d));
    auto _ = readln(); // dbg
}