#include <bits/stdc++.h>
long long MOD = 1e9 + 7;
using namespace std;
void print(long long x) {
  printf("%lld", &x);
  return;
}
int sum(long long n) {
  int res = 0;
  while (n) {
    res += n % 10;
    n /= 10;
  }
  return res;
}
int main() {
  int n, m;
  cin >> n >> m;
  long long a[3000], b[3000], x;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= m; ++i) cin >> b[i];
  cin >> x;
  long long sa[3000], sb[3000];
  sa[0] = sb[0] = 0;
  for (int i = 1; i <= max(n, m); ++i) {
    sa[i] = sa[i - 1] + a[i];
    sb[i] = sb[i - 1] + b[i];
  }
  long long ma[3000], mb[3000];
  for (int i = 1; i <= n; ++i) {
    long long M = 1e17;
    for (int j = 1; j <= n + 1 - i; ++j) {
      M = min(M, sa[j + i - 1] - sa[j - 1]);
    }
    ma[i] = M;
  }
  for (int i = 1; i <= m; ++i) {
    long long M = 1e17;
    for (int j = 1; j <= m + 1 - i; ++j) {
      M = min(M, sb[j + i - 1] - sb[j - 1]);
    }
    mb[i] = M;
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    int h = m;
    while (mb[h] * ma[i] > x && h) {
      h--;
    }
    ans = max(ans, h * i);
  }
  cout << ans;
}
