#include <cstdio>
#include <cassert>
#include <cstring>
#include <algorithm>

using namespace std;

const int maxn = 310;

int x, a, y, b, l;
char f[maxn][maxn][maxn];

bool solve( int w )
{
  memset(f, 0, sizeof(f));
  f[0][x][y] = 1;
  for (int i = 0; i < l; i++)
    for (int j = 0; j <= x; j++)
      for (int k = 0; k <= y; k++)
        if (f[i][j][k])
          for (int t = 0; t <= j && t * a < w + a; t++)
          {
            int tt = max((w - t * a + b - 1) / b, 0);
            if (tt > k)
              continue;
            f[i + 1][j - t][k - tt] = 1;
          }
  for (int i = 0; i <= x; i++)
    for (int j = 0; j <= y; j++)
      if (f[l][i][j])
        return true;
  return false;
}

int main()
{
  freopen("bridge.in", "r", stdin);
  freopen("bridge.out", "w", stdout);

  assert(scanf("%d%d%d%d%d", &x, &a, &y, &b, &l) == 5);
  assert(1 <= x && x <= 150);
  assert(1 <= a && a <= 150);
  assert(1 <= y && y <= 150);
  assert(1 <= b && b <= 150);
  assert(1 <= l && l <= 150);
  assert(x + y >= l);
  int mi = 0, ma = (x * a + y * b) / l;
  while (mi < ma)
  {
    int av = (mi + ma + 1) / 2;
    if (solve(av))
      mi = av;
    else
      ma = av - 1;
  }
  printf("%d\n", mi);

  return 0;
}
