N, M, P, Q= map(int,input().split()) cnt=0 while True: for i in range(1,13): cnt+=1 if P <= i <= (P+Q-1): N -= M*2 else: N -= M if N <= 0: print(cnt) exit()