#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
  x = 0;
  char c = getchar();
  int sgn = 1;
  while (c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  x *= sgn;
}
template <typename T>
void out(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x >= 10) out(x / 10);
  putchar(x % 10 + '0');
}
long long a[2005];
long long b[2005];
long long suma[2005];
long long sumb[2005];
long long mina[2005];
long long minb[2005];
int main() {
  int n, m;
  read(n), read(m);
  for (int i = 1; i <= n; i++) {
    read(a[i]);
    suma[i] = suma[i - 1] + a[i];
  }
  for (int i = 1; i <= m; i++) {
    read(b[i]);
    sumb[i] = sumb[i - 1] + b[i];
  }
  long long k;
  read(k);
  memset(mina, 0x3f, sizeof(mina));
  memset(minb, 0x3f, sizeof(minb));
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++)
      mina[j - i + 1] = min(mina[j - i + 1], suma[j] - suma[i - 1]);
  for (int i = 1; i <= m; i++)
    for (int j = i; j <= m; j++)
      minb[j - i + 1] = min(minb[j - i + 1], sumb[j] - sumb[i - 1]);
  long long s = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (mina[i] * minb[j] <= k) s = max(s, 1LL * i * j);
    }
  out(s), putchar('\n');
  return 0;
}
