#include <bits/stdc++.h>
using namespace std;
long long int n, m, a[2002], b[2002], mx, pmx[4000002];
int main() {
  scanf("%lld %lld", &n, &m);
  scanf("%lld", a);
  for (int i = 1; i < n; ++i) {
    scanf("%lld", a + i);
    a[i] += a[i - 1];
  }
  scanf("%lld", b);
  for (int i = 1; i < m; ++i) {
    scanf("%lld", b + i);
    b[i] += b[i - 1];
  }
  scanf("%lld", &mx);
  vector<pair<long long int, long long int> > v, p;
  for (int i = 0; i < n; ++i) {
    for (int pp = 0; pp + i < n; ++pp) {
      long long int x = a[pp + i];
      if (pp) x -= a[pp - 1];
      v.push_back(pair<long long int, long long int>(x, i + 1));
    }
  }
  for (int i = 0; i < m; ++i) {
    for (int pp = 0; pp + i < m; ++pp) {
      long long int x = b[pp + i];
      if (pp) x -= b[pp - 1];
      p.push_back(pair<long long int, long long int>(x, i + 1));
    }
  }
  sort(p.begin(), p.end());
  pmx[0] = p[0].second;
  for (int i = 1; i < (int)p.size(); ++i)
    pmx[i] = std::max(pmx[i - 1], p[i].second);
  long long int ans = 0;
  for (int i = 0; i < (int)v.size(); ++i) {
    if (v[i].first > mx) continue;
    vector<pair<long long int, long long int> >::iterator it = upper_bound(
        p.begin(), p.end(),
        pair<long long int, long long int>(mx / v[i].first, 9999990));
    if (it == p.begin()) continue;
    it--;
    if ((it != p.end()) && (it->first * v[i].first <= mx))
      ans = max(v[i].second * pmx[it - p.begin()], ans);
  }
  printf("%lld\n", ans);
  return 0;
}
