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