uses
  Math;

const
  MAXN = 150;

var
  x, a, y, b, l, ri, le, m : integer;

function can(m : integer) : boolean;
var
  tab : array[0..maxn, 0..maxn] of integer;
  i, j, k, t : integer;
begin
  for i := 0 to x do begin
    for j := 0 to y do begin
      tab[i][j] := 0;
    end;
  end;
  for i := 0 to x do begin
    for j := 0 to y do begin
      for k := 0 to i do begin
        t := (m - k * a - 1) div b + 1;
        if (m <= k * a) then begin
          t := 0;
        end;
        if (t <= j) then begin
          tab[i][j] := max(tab[i][j], tab[i - k][j - t] + 1);
        end;
      end;
    end;
  end;
  result := tab[x][y] >= l;
end;

begin
  reset(input, 'bridge.in');
  rewrite(output, 'bridge.out');
  read(x, a, y, b, l);
  assert((1 <= x) and (x <= MAXN));
  assert((1 <= a) and (a <= MAXN));
  assert((1 <= y) and (y <= MAXN));
  assert((1 <= b) and (b <= MAXN));
  assert((1 <= l) and (l <= MAXN));
  assert((x + y >= l));
  le := 0;
  ri := x * a + y * b + 1;
  while (ri - le > 1) do begin
    m := (le + ri) div 2;
    if (can(m)) then begin
      le := m;
    end else begin
      ri := m;
    end;
  end;
  writeln(le);
end.