#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "inline")
using namespace std;
const int N = 2005;
int n, m, ans, x;
int a[N], b[N], sa[N], sb[N], sm[N];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]), sa[i] = sa[i - 1] + a[i];
  for (int i = 1; i <= m; ++i) scanf("%d", &b[i]), sb[i] = sb[i - 1] + b[i];
  scanf("%d", &x);
  memset(sm, 0x3f, sizeof sm);
  for (int u = 1; u <= n; ++u)
    for (int d = u; d <= n; ++d)
      sm[d - u + 1] = min(sm[d - u + 1], sa[d] - sa[u - 1]);
  for (int l = 1; l <= m; ++l) {
    for (int r = l; r <= m; ++r) {
      int lim = x / (sb[r] - sb[l - 1]);
      int len = lower_bound(sm + 1, sm + 1 + n, lim + 1) - sm - 1;
      ans = max(ans, len * (r - l + 1));
    }
  }
  printf("%d\n", ans);
  return 0;
}
