def main(): d = list(map(int,input().split())) A = d[0] B = d[1] C = d[2] D = d[3] u = 1 + C print(min(A , D // u)) if __name__ == '__main__': main()