v,m,a,t = map(int, input().split()) print(min(v,m//a,t//(a+1)))