#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2000;
long long N, M, X, A[Maxn + 5], B[Maxn + 5];
long long suma[Maxn + 5], sumb[Maxn + 5];
long long fa[Maxn + 5], fb[Maxn + 5];
int main() {
  scanf("%d %d", &N, &M);
  for (int i = 1; i <= N; i++) {
    scanf("%d", &A[i]);
    suma[i] = suma[i - 1] + A[i];
  }
  for (int i = 1; i <= M; i++) {
    scanf("%d", &B[i]);
    sumb[i] = sumb[i - 1] + B[i];
  }
  scanf("%d", &X);
  memset(fa, 0x3f, sizeof fa);
  memset(fb, 0x3f, sizeof fb);
  for (int l = 1; l <= N; l++)
    for (int i = 1; i + l - 1 <= N; i++)
      fa[l] = min(fa[l], suma[i + l - 1] - suma[i - 1]);
  for (int l = 1; l <= M; l++)
    for (int i = 1; i + l - 1 <= M; i++)
      fb[l] = min(fb[l], sumb[i + l - 1] - sumb[i - 1]);
  int ans = 0;
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++)
      if (fa[i] * fb[j] <= X) ans = max(ans, i * j);
  printf("%d\n", ans);
  return 0;
}
