#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000 + 5;
const int maxm = 2000 + 5;
const int inf = 0x3f3f3f3f;
int n, m;
int a[maxn];
int b[maxm];
int x;
int f[maxn];
int g[maxm];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  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;
  memset(f, inf, sizeof(f));
  memset(g, inf, sizeof(g));
  for (int i = 1; i <= n; ++i) {
    int s = 0;
    for (int j = 1; j <= n; ++j) {
      s += a[j];
      if (j >= i) {
        s -= a[j - i];
        f[i] = min(f[i], s);
      }
    }
  }
  for (int i = 1; i <= m; ++i) {
    int s = 0;
    for (int j = 1; j <= m; ++j) {
      s += b[j];
      if (j >= i) {
        s -= b[j - i];
        g[i] = min(g[i], s);
      }
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if ((long long)f[i] * g[j] <= x) {
        ans = max(ans, i * j);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
