Yasai,Niku,C,D=[int(i) for i in input().split()] for i in range(Yasai): if i*C<=Niku and i*(C+1)<=D: vegimax=i print(vegimax)