#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  int count = 0, kazu = min(x, y);
  count += (a * kazu + b * kazu);
  count += (a - kazu) * a;
  count += (b - kazu) * b;
  cout << count << endl;
  return 0;
}
