#include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int m, d; cin >> m >> d; if(m < 7){ cout << 23 << '\n'; return 0; }else if(m == 8 && d <= 21){ cout << 23 << '\n'; }else{ cout << 24 << '\n'; } }