#include using namespace std; #define _p(...) (void)printf(__VA_ARGS__) #define forr(x,arr) for(auto&& x:arr) #define rep(i,a,b) for (int i = (a); i < (b); i++) #define rrep(i,a,b) for (int i = (b)-1; i >= (a); i--) #define ALL(x) (x).begin(), (x).end() #define BIT(n) (1LL<<(n)) #define SZ(x) ((int)(x).size()) #define fst first #define snd second #define dump( x ) cerr << #x << " = " << ( x ) << endl typedef long long ll; // ------------------------------------- void Main() { int x, y, x2, y2; scanf("%d%d", &x, &y); scanf("%d%d", &x2, &y2); int ans; if (x != y) { ans = max(x, y); } else { ans = x + (x2 == y2 && x2 < x); } _p("%d\n", ans); } int main() { cin.tie(0); ios::sync_with_stdio(false); Main(); return 0; }