#include #define ff first #define ss second #define ALL(x) (x).begin(), (x).end() #define DV(x) cerr << ">> " << #x << " = >" << x << "<" << endl #define F(i, a, b) for ( int i = (a); i < (b); ++i ) #define FD(i, a, b) for ( int i = (a); i >= (b); --i ) #define PB push_back #define R1(a) scanf( "%d", &a ) #define R2(a, b) scanf( "%d%d", &a, &b ) #define R3(a, b, c) scanf( "%d%d%d", &a, &b, &c ) using namespace std; #define D(args...) dbg,args; cerr< debugger & operator,(const T & v) { cerr << ">" << v << "< "; return *this; } } dbg; typedef long long ll; typedef vector vi; typedef pair ii; typedef vector vii; typedef vector Matrix; const int INF = 1e9 + 7; const double PI = acos(-1); const double EPS = 1e-9; template ostream & operator<<(ostream & os, const pair & p) { return os << p.ff << " " << p.ss; } template ostream & operator<<(ostream & os, const vector & v) { F(i,0,v.size()) { if (i) os << " "; os << v[i]; } return os; } int main() { ios::sync_with_stdio(0); int p, d, m, s, res = 0; cin >> p >> d >> m >> s; while (s >= p) { s -= p; ++res; p = max( p-d, m ); } cout << res << endl; return 0; }