#include <bits/stdc++.h>
inline int read() {
  char c = getchar();
  int x = 0;
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - 48, c = getchar();
  return x;
}
long long prea[2005], preb[2005];
long long ansa[2005], ansb[2005];
int n, m, ans = 0;
long long X;
int main() {
  n = read(), m = read();
  for (register int i = 1; i <= n; i++) prea[i] = prea[i - 1] + read();
  for (register int i = 1; i <= m; i++) preb[i] = preb[i - 1] + read();
  X = read();
  memset(ansa, 20, sizeof(ansa));
  memset(ansb, 20, sizeof(ansb));
  for (register int i = 1; i <= n; i++)
    for (register int j = 1; j + i - 1 <= n; j++)
      ansa[i] = ((ansa[i]) < (prea[i + j - 1] - prea[j - 1])
                     ? (ansa[i])
                     : (prea[i + j - 1] - prea[j - 1]));
  for (register int i = 1; i <= m; i++)
    for (register int j = 1; j + i - 1 <= m; j++)
      ansb[i] = ((ansb[i]) < (preb[i + j - 1] - preb[j - 1])
                     ? (ansb[i])
                     : (preb[i + j - 1] - preb[j - 1]));
  for (register int i = 1; i <= n; i++)
    for (register int j = 1; j <= m; j++)
      if (ansa[i] * ansb[j] <= X) ans = ((ans) > (i * j) ? (ans) : (i * j));
  std::cout << ans;
  return 0;
}
