#include using namespace std; int howManyGames(int p, int d, int m, int s) { int ans=0; int cost=p; while(s>=0) { if(ans==0) { //ans++; s-=cost; if(s>=0) ans++; cost-=d; } else if(cost>=m) { //ans++; s-=cost; if(s>=0) ans++; cost-=d; } else { // cost-=m; s-=m; if(s>=0) ans++; } // cout << cost << " " << s << "\n"; } 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; }