#include using namespace std; #define all(v) (v).begin(),(v).end() #define pb(a) push_back(a) #define rep(i, n) for(int i=0;i> a >> b >> c >> d; int cnt = b + 31 - a; if(cnt >= c) { cout << 1 << endl; } else if(cnt >= d) { cout << 2 << endl; } else cout << 3 << endl; return 0; }