#!/bin/python3 import sys import math def howManyGames(p, d, m, s): # Return the number of games you can buy i= 0 remaining = s price = p while remaining>=price: i = i+1 remaining -= price if price>m: price = max(m,price-d) return i if __name__ == "__main__": p, d, m, s = input().strip().split(' ') p, d, m, s = [int(p), int(d), int(m), int(s)] answer = howManyGames(p, d, m, s) print(answer)