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 i, k=0, x=0, count=1; int arr[] = new int[p/d]; for(i=p; i>=m; i=i-d) { arr[k++] = i; } k=0; while(x<=s&&k
0) while(x<=s) { x+=arr[k-1]; count++; } return count; } 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(); } }