def main(): a, b, c, d= (int(x) for x in input().split()) s1= b/c s2= d/(c+1) print(min(a,s1,s2)) if __name__ == '__main__': main()