A = int(input())
B = int(input())
C = int(input())
D = int(input())
P = int(input())
x = A * P
if C < P:
y = B + ((P - C) * D)
else:
y = B
if x < y:
print(x)
else:
print(y)
A = int(input())
B = int(input())
C = int(input())
D = int(input())
P = int(input())
x = A * P
if C < P:
y = B + ((P - C) * D)
else:
y = B
if x < y:
print(x)
else:
print(y)