#!/bin/python3 import sys p, d, m, s = [int(i) for i in input().split()] a = [] while p.__ge__(m): a.append(p) p -= d if sum(a).__lt__(s): while s.__ge__(sum(a)): a.append(p) print(len(a)-2)