#include #define x first #define y second using namespace std; typedef long long ll; typedef pair pii; typedef pair pll; typedef vector vi; ostream& operator<<(ostream &out, const pii &a) { return out << '(' << a.x << ", " << a.y << ')'; } istream& operator>>(istream &in, pii &a) { return in >> a.x >> a.y; } const int INF = 2147483647; const ll LLINF = 9223372036854775807LL; // lambda-expression: [] (args) -> retType { body } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); // cerr << boolalpha; (cout << fixed).precision(10); ll p, d, m, s; cin >> p >> d >> m >> s; ll ans = 0; bool bought; do { bought = s >= p; if (bought) { s -= p; p = max(p - d, m); ans++; } } while (bought); cout << ans << endl; return 0; }