import std.algorithm, std.array, std.container, std.range, std.bitmanip; import std.numeric, std.math, std.bigint, std.random, core.bitop; import std.string, std.regex, std.conv, std.stdio, std.typecons; void main() { auto rd1 = readln.split.map!(to!int); auto x = rd1[0], y = rd1[1]; auto rd2 = readln.split.map!(to!int); auto x2 = rd2[0], y2 = rd2[1]; auto r = min(x, y); r += (x - r) + (y - r); if (x == y && x2 == y2 && x > x2) r += 1; writeln(r); }