a=[int(i) for i in input().split()] b=[int(i) for i in input().split()] c=a[0]*a[1] d=b[0]+b[1]+b[2] if c-d<0: print("-1") else: print(c-d)