#!/usr/bin/perl
use strict;
use warnings;

chomp(my $str = <STDIN>);
my ($a, $b, $ab, $a_needs, $b_needs) = split / /, $str;
my $ans;
my $bigger = $a_needs > $b_needs ? $a_needs : $b_needs;

if (2 * $ab < $a + $b) {
    if (2 * $ab <= $a && 2 * $ab <= $b) {
        print ($bigger * $ab * 2);
    } else {
        if ($a_needs > $b_needs) {
            print ($b_needs * $ab * 2 + ($a_needs - $b_needs) * $a);
        } else {
            print ($a_needs * $ab * 2 + ($b_needs - $a_needs) * $b);
        }
    }
} else {
    print ($a_needs * $a + $b_needs * $b);
}
print "\n";
