#include using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; b += 31; if(b - a >= c) { cout << 1 << endl; } else if(b - a >= d) { cout << 2 << endl; } else { cout << 3 << endl; } }