#!/bin/python3 import sys def howManyGames(p, d, m, s): cur_price = p bought = 0 while s >= cur_price: bought += 1 s -= cur_price cur_price -= d if cur_price <= m: cur_price = m return bought 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)