#include using namespace std; typedef unsigned long long ll; typedef std::pair P; #define For(i, a, b) for(int i = (a); i < (b); i++) #define Rep(i, n) For(i, 0, (n)) #define Rrep(i, n) for(int i = (n - 1); i >= 0; i--) #define All(i, x) for(typeof(x.begin()) i = x.begin(); i != x.end(); i++) #define ReAll(i, x) for(typeof(x.end()) i = x.end(); i != x.begin(); i--) #define pb push_back const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; const int MAX = 100000; const int INF = 1e9; const int MOD = 1000000007; const string END = "\n"; void solve(){ int n, m, p, q; cin >> n >> m >> p >> q; int a[12] = {}; For(i, 1, 13){ if(i >= p && i <= p + q - 1){ a[i-1] = m * 2; }else{ a[i-1] = m; } } bool flag = false; int ans = 0; while(n > 0){ Rep(i, 12){ if(flag) break; n -= a[i]; ans += 1; if(n <= 0) flag = true; } } cout << ans << END; } int main(){ cin.tie(0); ios::sync_with_stdio(false); solve(); return 0; }