main(n,m,p,q,c,mo){ scanf("%d%d%d%d",&n,&m,&p,&q); q=p+q-1; if(q>12)q=12; c=0; mo=0; for(;;){ if(n<=0)break; ((mo+1)>=p&&(mo+1)<=q)?n-=(m*2):(n-=m); c++; mo++; mo%=12; } printf("%d",c); }