chars = input().split(" ") leaves = int(chars[0]) per_lost = int(chars[1]) month_list = [] for x in range(int(chars[2]), int(chars[2]) + int(chars[3])): month_list.append(x) if 12 in month_list: month_list.remove(12) month_list.append(0) counter = 0 while True: if leaves <= 0: print(counter) break else: counter += 1 if (counter % 12) in month_list: leaves -= per_lost * 2 else: leaves -= per_lost