#!/bin/python import sys def howManyGames(p, d, m, s): # Return the number of games you can buy num_games = 0 have_money = True prize = p while have_money == True: if prize > m: prize = prize else: prize = m if prize > s: have_money = False break if s >= prize: num_games += 1 s = s - prize prize = p - num_games * d 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