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