#include <bits/stdc++.h>
int main() {
  int c1, c2, n, m, k, i, j;
  scanf("%d%d", &c1, &c2);
  scanf("%d%d", &n, &m);
  scanf("%d", &k);
  int a[100000] = {0};
  if (n * m <= k) {
    printf("0");
    return 0;
  }
  for (i = 0; i <= 10000; i++) {
    if (i == 0) {
      a[i + c1] = a[i + c1] > a[i] + n ? a[i + c1] : a[i] + n;
      a[i + c2] = a[i + c2] > a[i] + 1 ? a[i + c2] : a[i] + 1;
      continue;
    }
    if (a[i] == 0) continue;
    if (i + c1 <= 10000) {
      a[i + c1] = a[i + c1] > a[i] + n ? a[i + c1] : a[i] + n;
    }
    if (i + c2 <= 10000) {
      a[i + c2] = a[i + c2] > a[i] + 1 ? a[i + c2] : a[i] + 1;
    }
    if (a[i] >= n * m - k) {
      printf("%d", i);
      return 0;
    }
  }
  return 0;
}
