A, B, C, D = map(int, input().split()) print(min(B // C, D, A))