#include #define int long long using namespace std; signed main() { int m, d; cin >> m >> d; if (m == 4 && d == 1)cout << 1000 << endl; else cout << m + d << endl; }