import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int howManyGames(int p, int d, int m, int s) { int numGames = 0; int money = s; int nextCost = p; // While we still have money to buy one more game... while (money >= nextCost) { // Buy the game money -= nextCost; numGames++; // Calculate cost of next game if (nextCost > m) { nextCost = Math.max(nextCost - d, m); } } return numGames; } public static void main(String[] args) { Scanner in = new Scanner(System.in); int p = in.nextInt(); int d = in.nextInt(); int m = in.nextInt(); int s = in.nextInt(); int answer = howManyGames(p, d, m, s); System.out.println(answer); in.close(); } }