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