A, B, C, D = map(int, input().split()) if D <= C: print(0) elif B < (A * C): print(int((B / C))) else: print(int(D / (1 + C)))