N,M,P,Q = map(int,input().split()) count = 0 while N > 0: for month in range(1,12+1): if P <= month <= (P + Q - 1): N -= (2 * M) count += 1 else: N -= M count += 1 if N <= 0: break print(count)