#!/usr/bin/env python3 """Solution for: https://www.hackerrank.com/contests/hourrank-23/challenges/halloween-sale """ import sys def game_count(p: int, d: int, m, s) -> int: count = 0 while s > 0: if s >= max(p, m): s -= max(p, m) p -= d count += 1 else: break return count def main(): """Print ...""" p, d, m, s = [int(x) for x in input().split()] result = game_count(p, d, m, s) print(result) if __name__ == '__main__': main()