A, B, C, D = map(int, input().split()) if D <= C: print(0) else: ans = int(min(A, (B / C))) print(ans)