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