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