#include using namespace std; int howManyGames(int p, int d, int m, int s) { int count =0,cost=0; while (cost<=s){ if(p<=m){ cost = m+cost; count++; } else{ cost = cost + p; p=p-d; count ++; } } return count-1; } 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; }