#!/bin/python3 import sys def howManyGames(p, d, m, s): # Return the number of games you can buy count = 0 if( s < p ): return 0 elif(s == p): return 1 else: while(s >= p): s = s - p count = count + 1 if(count >= 1 and p >= m): p = p - d if( p < m): p = m return count 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)