N, M, P, Q = map(int, raw_input().split()) fallleaf = [M, M, M, M, M, M, M, M, M, M, M, M] for i in range(P, P+Q): fallleaf[i%12] += M month = 1 while True: N -= fallleaf[month%12] if N <= 0: break month += 1 print month