import java.util.Scanner; /** * Created by Yurii on 9/9/2017. */ public class Solution { static int howManyGames(int p, int d, int m, int s) { int numbers = 0; int cost = p; while( s >= cost){ s-=cost; numbers ++; if(cost-d>m) cost-=d; else cost = m; } return numbers; } 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(); } }