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