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