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