#!/bin/python3 import sys def nextprice(p,m,d): if p < m: return m if p > m: return p return m def howManyGames(p, d, m, s): num = 0 n = nextprice(p,m,d) while s >= n: s-= n num += 1 p = p-d n = nextprice(p,m,d) return num 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)