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