import std.stdio, std.array, std.conv, std.algorithm, std.string, std.numeric, std.range;
void main() {
        auto a = readln.strip.to!int;
        auto b = readln.strip.to!int;
        auto c = readln.strip.to!int;
        auto d = readln.strip.to!int;
        auto e = readln.strip.to!int;
        min(a*e, max(b,b+(e-c)*d)).writeln;
}