object Main {
    def main(args: Array[String]) = {
        val List(a, b, c, d, e) = io.Source.stdin.getLines.map(_.toInt).toList
        println(if (a<0 && b>0) a*(-c)+d+b*e else if(b<=0) (b-a)*c else if(a>=0) (b-a)*e)
    }
}