#!/bin/python3 import sys def price(p, d, m, games): prices = p - d * games if prices < m: return m else: return prices def howManyGames(p, d, m, s): # Return the number of games you can buy games = 0 while s >= 0: s -= price(p, d, m, games) games += 1 games -= 1 return games 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)