#include <bits/stdc++.h>
using namespace std;
int n, m;
long long a[2005], b[2005];
long long res[2005];
long long res2[2005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  memset(res, 0x3f, sizeof res);
  memset(res2, 0x3f, sizeof res2);
  cin >> n >> m;
  for (int i = 0; i < (signed)(n); i++) {
    cin >> a[i];
  }
  for (int i = 0; i < (signed)(m); i++) cin >> b[i];
  long long x;
  cin >> x;
  for (int i = 0; i < (signed)(n); i++) {
    long long sm = a[i];
    res[1] = min(res[1], sm);
    for (int j = (i + 1); j <= (signed)(n - 1); j++) {
      sm += a[j];
      res[j - i + 1] = min(res[j - i + 1], sm);
    }
  }
  for (int i = (n - 1); i >= 1; i--) {
    res[i] = min(res[i], res[i + 1]);
  }
  for (int i = 0; i < (signed)(m); i++) {
    long long sm = b[i];
    res2[1] = min(res2[1], sm);
    for (int j = (i + 1); j <= (signed)(m - 1); j++) {
      sm += b[j];
      res2[j - i + 1] = min(res2[j - i + 1], sm);
    }
  }
  for (int i = (m - 1); i >= 1; i--) {
    res2[i] = min(res2[i], res2[i + 1]);
  }
  int ans = 0;
  int j = m;
  for (int i = (1); i <= (signed)(n); i++) {
    while (j >= 1 && res[i] * res2[j] > x) --j;
    ans = max(ans, i * j);
  }
  cout << ans << "\n";
  return 0;
}
