A = int(input()) B = int(input()) C = int(input()) D = int(input()) E = int(input()) if A > 0 : print((B-A)*E) else : print((abs(A)*C + D + B*E))