import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Solution { static final boolean DEBUG = false; static void solve() { int p = nextInt(); int d = nextInt(); int m = nextInt(); int currentMoney = nextInt(); int currentCost = p; int bought = 0; while(currentMoney >= currentCost){ bought ++; currentMoney -= currentCost; currentCost -=d; currentCost = Math.max(currentCost, m); } System.out.println(bought); } public static void main(String[] args) { solve(); writer.close(); } static BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer tokenizer = new StringTokenizer(""); static PrintWriter writer = new PrintWriter(System.out); static String next() { while (!tokenizer.hasMoreTokens()) try { tokenizer = new StringTokenizer(bf.readLine()); } catch (Exception e) { return null; } return tokenizer.nextToken(); } static int nextInt() { return Integer.parseInt(next()); } static long nextLong() { return Long.parseLong(next()); } static double nextDouble() { return Double.parseDouble(next()); } static int[] nextIntArr(int n) { int[] a = new int[n]; for (int i = 0; i < a.length; i++) { a[i] = nextInt(); } return a; } }