#define _USE_MATH_DEFINES #include //cin, cout #include //vector #include //sort,min,max,count #include //string,getline, to_string #include //abs(int) #include //swap, pair #include //deque #include //INT_MAX #include //bitset #include //sqrt, ceil. M_PI, pow, sin #include //fixed #include //setprecision #include //stringstream #include //gcd, assumlate #include //randam_device #include //numeric_limits #include //tm using namespace std; constexpr int64_t D_MOD = 1000000007; constexpr int64_t F_MOD = 998244353; inline int Calc_Age(int yy1, int mm1, int dd1, int yy2, int mm2, int dd2) { //年齢 if (yy1 > yy2) { return -1; } else if (yy1 == yy2) { if (mm1 > mm2) { return -1; } else if (mm1 == mm2) { if (dd1 > dd2) { return -1; } else { return 0; } } else { return 0; } } else { if (mm1 > mm2) { return yy2 - yy1 - 1; } else if (mm1 == mm2) { if (dd1 > dd2) { return yy2 - yy1 - 1; } else { return yy2 - yy1; } } else { return yy2 - yy1; } } } int main() { int M, D; cin >> M >> D; int ans = Calc_Age(2000, 8, 22, 2024, M, D); cout << ans << endl; return 0; }