#include #include using namespace std; int main() { int p, d, m, s; if (4 != scanf("%d %d %d %d", &p, &d, &m, &s)) { return 1; } int count=0; for (int cost=p; s >= cost; ++count) { s -= cost; cost = (cost-d > m ? cost-d : m); } printf("%d\n", count); return 0; }