#include using namespace std; using ll=long long; using ull=unsigned long long; using pii=pair; #define INF LONG_MAX #define MOD 1000000007 #define rng(a) a.begin(),a.end() #define rrng(a) a.end(),a.begin() #define endl "\n" int main(){ ios::sync_with_stdio(false); cin.tie(0); int M,D; cin>>M>>D; if(M==4&&D==1)cout<<0<