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

const int maxn = 310;

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

bool solve( int w )
{
  int c = 0;
  memset(f[c], 0, sizeof(f[c]));
  f[c][x][y] = true;
  for (int i = 0; i < l; i++, c = 1 - c)
  {
    memset(f[1 - c], 0, sizeof(f[1 - c]));
    for (int j = 0; j <= x; j++)
      for (int k = 0; k <= y; k++)
        if (f[c][j][k])
        {
          int tj = 0, tk = (w + b - 1) / b;
          int sj = 0, sk = b * tk;
          while (tj <= j && sj < w + a)
          {
            if (tk <= k)
              f[1 - c][j - tj][k - tk] = true;
            tj++, sj += a;
            while (tk > 0 && sj + sk >= w + b)
              tk--, sk -= b;
          }
        }
  }
  for (int i = 0; i <= x; i++)
    for (int j = 0; j <= y; j++)
      if (f[c][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;
}
