#!/bin/python import sys def howManyGames(p, d, m, s): # Return the number of games you can buy nr_of_games = 0 left_money = s actual_price = p while left_money > 0: if left_money >= actual_price: left_money = left_money - actual_price nr_of_games += 1 actual_price = max(actual_price - d, m) else: return nr_of_games return nr_of_games if __name__ == "__main__": p, d, m, s = raw_input().strip().split(' ') p, d, m, s = [int(p), int(d), int(m), int(s)] answer = howManyGames(p, d, m, s) print answer