import java.util.Locale; import java.util.Scanner; public class HalloweenSale { public static void main(String[] args) { try (Scanner in = new Scanner(System.in)) { in.useLocale(Locale.ENGLISH); int p = in.nextInt(); int d = in.nextInt(); int m = in.nextInt(); int s = in.nextInt(); int count = 0; int currentPrice = p; while (s >= currentPrice) { s -= currentPrice; currentPrice -= d; currentPrice = Math.max(currentPrice, m); count++; } System.out.println(count); } } }