import std.stdio, std.algorithm, std.range, std.format, std.numeric, std.string, std.conv, std.array;

void main() {
    int a, b, c, d;
    readf("%d\n", &a);
    readf("%d\n", &b);
    readf("%d\n", &c);
    readf("%d\n", &d);
    writeln(min(a, b) + min(c, d));
}
