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