N, M, P, Q = map(int,input().split()) m = 0 ans = 0 while N > 0: m += 1 ans += 1 if P <= m < (P+Q): N -= M*2 else: N -= M if m > 12: m = 1 print(ans)