N, M, P, Q = map(int, input().split()) L = [M] * 12 for i in range(P-1, P-1+Q): L[i] += M c = 0 while N > 0: N -= L[c % 12] c += 1 print(c)