https://www.acmicpc.net/problem/14470
a=int(input()) b=int(input()) c=int(input()) d=int(input()) e=int(input()) time=0 if a<0: time+=abs(a)*c a=0 if a==0: time+=d time+=(b-a)*e print(time)