n,m,p,q=map(int,input().split()) s=[] c=0 for i in range(0,12): if p-1<=i and i<=p+q-2: s.append(2*m) else: s.append(m) while n>0: n=n-s[c%12] c+=1 print(c)