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