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 c=0; if(s-p>0) {s-=p;c++; while(s>=0) { if(p-d>m) { p-=d; s-=p; c++;} else { s-=m; c++;} } } return s<0?c-1:c; } 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(); } }