{$mode objfpc} var p,d,m,s,i:int64; begin read(p,d,m,s); while s >= p do begin inc(i); s:=s-p; p:=p-d; if p < m then p:=m; end; write(i); end.