l = input().split() l = list(map(int,l)) leaves = l[0] fallen = l[1] wind_season = l[2] wind_lasting = l[3] month = 1 wind_count = 0 count = 0 is_wind = False while True: if leaves <= 0: print(count) break if month == wind_season: is_wind = True if is_wind: wind_count += 1 if wind_count > wind_lasting: wind_count = 0 is_wind = False if is_wind: leaves -= (fallen * 2) else: leaves -= fallen count += 1 month += 1 if month == 13: month = 1