n=list(map(int,input().split())) cnt=0 a=n[1]//n[2] b=c[3]//(n[2]+1) min=n[0] if(min>a): min=a if(min>b): min=b print(min)