https://www.acmicpc.net/problem/5532
l=int(input()) a=int(input()) b=int(input()) c=int(input()) d=int(input()) sum=0 sum1=0 if a%c==0: sum=a//c else: sum=a//c+1 if b%d==0: sum=b//d else: sum1=b//d+1 print(min(l-sum,l-sum1))