#include using namespace std; int M, D; int main() { cin >> M >> D; if (M < 8) cout << 23 << endl; else if (M == 8) { if (D < 22) cout << 23 << endl; else cout << 24 << endl; } else cout << 24 << endl; return 0; }