#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m, p, q; cin >> n >> m >> p >> q; int mon = 1; int sum = 0; while (n > 0) { if (p <= mon && mon < p + q) { n -= 2 * m; } else n -= m; mon++; sum++; if (mon == 12) mon = 1; } cout << sum << endl; }