#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int n, m;
long long a[N], b[N];
long long f[N], g[N];
long long x;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%lld", &a[i]);
  for (int i = 1; i <= m; ++i) scanf("%lld", &b[i]);
  scanf("%lld", &x);
  for (int i = 1; i <= n; ++i) f[i] = x + 1;
  for (int i = 1; i <= m; ++i) g[i] = x + 1;
  for (int i = 1; i <= n; ++i) {
    long long sum = 0;
    for (int j = i; j <= n; ++j) {
      sum += a[j];
      f[j - i + 1] = min(f[j - i + 1], sum);
    }
  }
  for (int i = 1; i <= m; ++i) {
    long long sum = 0;
    for (int j = i; j <= m; ++j) {
      sum += b[j];
      g[j - i + 1] = min(g[j - i + 1], sum);
    }
  }
  int res = 0;
  for (int i = 1, j = m; i <= n; ++i) {
    for (; j && f[i] * g[j] > x; --j)
      ;
    if (!j) break;
    res = max(res, i * j);
  }
  printf("%d\n", res);
  return 0;
}
