#include <bits/stdc++.h>
using namespace std;
int main() {
  int a1, a2, k1, k2, n, fmax, fmin, smin, smax, d, kb, b, ks, ab, as, sum1,
      sum2;
  cin >> a1 >> a2 >> k1 >> k2 >> n;
  if (k1 > k2) {
    ks = k2;
    as = a2;
    kb = k1;
    ab = a1;
  } else {
    ks = k1;
    as = a1;
    kb = k2;
    ab = a2;
  }
  fmin = ab * kb - ab;
  if (fmin > n) {
    cout << 0 << " ";
  } else {
    b = n - fmin;
    smin = b - (as * ks - as);
    if (smin <= 0) {
      cout << 0 << " ";
    } else {
      if (smin <= (as + ab))
        cout << smin << " ";
      else {
        cout << as + ab << " ";
      }
    }
  }
  fmax = n / ks;
  if (fmax > as) {
    fmax = as;
  }
  d = n - (fmax * ks);
  smax = d / kb;
  if (smax > ab) {
    smax = ab;
  }
  sum1 = fmax + smax;
  cout << sum1;
  return 0;
}
