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