#include <bits/stdc++.h>
inline int getint() {
  int r = 0, s = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') s = 0;
  for (; isdigit(c); c = getchar()) r = (((r << 2) + r) << 1) + (c ^ '0');
  return s ? r : -r;
}
int n, m, a[2020], b[2020];
int s1[2020][2020], s2[2020][2020], f[2020 * 2020], g[2020 * 2020];
int main() {
  n = getint();
  m = getint();
  for (int i = 1; i <= n; i++) a[i] = getint();
  for (int i = 1; i <= m; i++) b[i] = getint();
  int x = getint();
  memset(s1, 0, sizeof(s1));
  memset(s2, 0, sizeof(s2));
  memset(f, 0x3f, sizeof(f));
  memset(g, 0x3f, sizeof(g));
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      s1[i][j] = s1[i][j - 1] + a[j];
      f[j - i + 1] = std::min(f[j - i + 1], s1[i][j]);
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = i; j <= m; j++) {
      s2[i][j] = s2[i][j - 1] + b[j];
      g[j - i + 1] = std::min(g[j - i + 1], s2[i][j]);
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (1LL * f[i] * g[j] <= x) ans = std::max(ans, i * j);
    }
  printf("%d\n", ans);
  return 0;
}
