#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x;
}
long long n, m, x, a[5005], b[5005], cnt, num[5005], ans, sum[5005], suma[5005],
    sumb[5005];
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++) a[i] = read(), sum[i] = sum[i - 1] + a[i];
  for (int i = 1; i <= m; i++) b[i] = read(), num[i] = num[i - 1] + b[i];
  x = read();
  memset(suma, 0x7f, sizeof(suma));
  memset(sumb, 0x7f, sizeof(sumb));
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j + i - 1 <= n; j++) {
      suma[i] = min(suma[i], sum[j + i - 1] - sum[j - 1]);
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j + i - 1 <= m; j++) {
      sumb[i] = min(sumb[i], num[j + i - 1] - num[j - 1]);
    }
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      if (suma[i] * sumb[j] <= x) {
        ans = max(ans, i * j);
      }
    }
  }
  cout << ans;
  return 0;
}
