# coding: utf-8 # Your code here! a,b,c,d = map(int,input().split()) cnt=0 bb=b/c dd=d/(c+1) ans=min(a,min(bb,dd)) print(ans)