A,B,C,D=map(int, input().split()) ans = 0 while True: C -= A D -= B ans += 1 if C < A or D < B: break print(ans)