#!/bin/python3 import sys def howManyGames(p, d, m, s): # Return the number of games you can buy priceList = [] priceList.append(p) if(p>s): return(0) if(p==s): return(1) sum=p t=p while(True): t=t-d item=0 if(t<=m): item=m else: item=t sum = sum + item if(sum<=s): priceList.append(item) else: break return(len(priceList)) 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)