// Problem: No.2789 hako111223’s Master Thesis // Group: yukicoder // URL: https://yukicoder.me/problems/no/2789 // Memory Limit: 512 MB // Time Limit: 2000 ms // Author: lingfunny // // Powered by CP Editor (https://cpeditor.org) #include using namespace std; int a, b, c, d; int main() { scanf("%d%d%d%d", &a, &b, &c, &d); a = b + 31 - a; if (a < d) puts("3"); else if (a < c) puts("2"); else puts("1"); return 0; }