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