#!/bin/python3

import math
import os
import random
import re
import sys

# Complete the howManyGames function below.
def howManyGames(p, d, m, s):
    # Return the number of games you can buy
    count=0
    total_money=s
    initial_price=p
    decrement=d
    maturity=m
    if(total_money<initial_price):
        return 0
    while(total_money>=maturity):
        if(initial_price>m and total_money>=initial_price):
            total_money=total_money-initial_price
            initial_price=initial_price-decrement
            count+=1
        if(initial_price<=m and total_money>=m):
            total_money=total_money-maturity
            count+=1
        if(total_money>=m and total_money<initial_price):
            return count    
    return count            



if __name__ == '__main__':
    fptr = open(os.environ['OUTPUT_PATH'], 'w')

    pdms = input().split()

    p = int(pdms[0])

    d = int(pdms[1])

    m = int(pdms[2])

    s = int(pdms[3])

    answer = howManyGames(p, d, m, s)

    fptr.write(str(answer) + '\n')

    fptr.close()
