#include using namespace std; int howManyGames(int p, int d, int m, int s) { int last=p; int ans=0; bool first=true; while(s>0) { if(last<=m && first==false) { s=s-m; first=false; } else { s=s-last; last=last-d; first=false; } if(s>=0) ans++; } return ans; } 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; }