#include using namespace std; int main() { int p, d, m, s; cin >> p >> d >> m >> s; int max = 0; int currentCost = p; while (s >= currentCost) { s -= currentCost; max++; currentCost -= d; if (currentCost < m) currentCost = m; } cout << max << endl; return 0; }