import std.algorithm; import std.array; import std.conv; import std.math; import std.stdio; import std.string; import std.range; int readint() { return readln.chomp.to!int; } int[] readints() { return readln.split.map!(to!int).array; } int calc(int x, int y, int gx, int gy) { int ans = max(x, y); if (x == y && gx == gy && gx < x) { ans++; } return ans; } void main() { auto xs = readints(); auto ys = readints(); writeln(calc(xs[0], xs[1], ys[0], ys[1])); }