n,m,p,q=map(int,input().split()) p-=1 l=[m]*12 for i in range(q): l[p+i]*=2 cnt=0 while n>0: n-=l[cnt%12] cnt+=1 print(cnt)