#include using namespace std; typedef long long ll; typedef pair ii; typedef vector> graph; int main () { ios_base::sync_with_stdio(false); cin.tie(0); #ifdef LOCAL freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #else #define endl '\n' #endif int p, d, m, s; cin >> p >> d >> m >> s; int cur = p, ans = 0; while (s - cur >= 0) { ++ans; s -= cur; cur -= d; if (cur < m) cur = m; } cout << ans << endl; }