#include using namespace std; int main() { int M, D; cin >> M >> D; cout << (23 + (M * 100 + D >= 822)) << endl; }