#!/bin/python3 import sys # 20 3 6 80 = 1 + # 17 3 6 87 = 1 + # 14 3 6 70 = 1 + # 11 3 6 56 = 1 + # 8 3 6 48 = 1 + # 5 3 6 40 = 6 def howManyGames(p, d, m, s): # Return the number of games you can buy # Base case if s < p: return 0 if p <= m: p = m return s//p # 1 + return 1 + howManyGames(p-d, d, m, s-p) 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)