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