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