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