#include using namespace std; int main() { int n, m, p, q; cin >> n >> m >> p >> q; p--; q--; int c = 0; while (n > 0) { if (p <= c % 12 && c % 12 <= p+q) n -= 2 * m; else n -= m; c++; } cout << c << endl; }