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