#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
  char c = getchar();
  x = 0;
  int f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
}
const int N = 2007;
long long n, m, a[N], b[N], sa[N], sb[N], ans, mi, q;
int main() {
  read(n);
  read(m);
  for (int i = 1; i <= n; i++) read(a[i]), sa[i] = sa[i - 1] + a[i];
  for (int i = 1; i <= m; i++) read(b[i]), sb[i] = sb[i - 1] + b[i];
  read(q);
  for (int i = 1; i <= n; i++) {
    mi = 1e18;
    for (int j = 1; j <= n - i + 1; j++)
      mi = min(mi, sa[j + i - 1] - sa[j - 1]);
    long long p1 = m, p2 = m;
    while (p1 >= 0) {
      if ((sb[p2] - sb[p1]) * mi <= q) {
        ans = max(ans, (p2 - p1) * i);
        p1--;
      } else
        p2--;
    }
  }
  cout << ans << endl;
  return 0;
}
