#include <bits/stdc++.h>
using namespace std;
const long long int N = 5005;
const long long int mod1 = 998244353;
const long long int mod = 1e9 + 7;
struct dat {
  long long int l, r, i;
};
bool cmp(dat a, dat b) { return a.r < b.r; }
long long int a[N];
long long int b[N];
long long int s1[N];
long long int s2[N];
long long int n, m, x;
void solve() {
  cin >> n >> m;
  for (int i = (1); i <= (n); ++i) cin >> a[i];
  for (int i = (1); i <= (m); ++i) cin >> b[i];
  cin >> x;
  for (int i = (1); i <= (n); ++i) s1[i] = a[i] + s1[i - 1];
  for (int i = (1); i <= (m); ++i) s2[i] = b[i] + s2[i - 1];
  long long int ans = 0;
  for (int i = (1); i <= (n); ++i) {
    long long int sum = 1e10;
    for (int j = (1); j <= (n - i + 1); ++j)
      sum = min(sum, s1[j + i - 1] - s1[j - 1]);
    if (sum <= x) {
      for (int k = 1; k <= m; ++k) {
        if (sum * b[k] <= x) {
          long long int l = k, r = m + 1;
          while (r - l > 1) {
            long long int mid = (l + r) / 2;
            if ((s2[mid] - s2[k - 1]) * sum <= x)
              l = mid;
            else
              r = mid;
          }
          ans = max(ans, i * (l - k + 1));
        }
      }
    }
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
