#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
inline int read_int() {
  char c;
  int ret = 0, sgn = 1;
  do {
    c = getchar();
  } while ((c < '0' || c > '9') && c != '-');
  if (c == '-')
    sgn = -1;
  else
    ret = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  return sgn * ret;
}
inline long long read_ll() {
  char c;
  long long ret = 0, sgn = 1;
  do {
    c = getchar();
  } while ((c < '0' || c > '9') && c != '-');
  if (c == '-')
    sgn = -1;
  else
    ret = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  return sgn * ret;
}
inline bool Get_Line(string& s) {
  s.clear();
  char ch;
  while ((ch = getchar()) && ch != '\n' && ch != '\r') {
    if (ch == EOF) return false;
    s.push_back(ch);
  }
  return true;
}
int n, m, a[2000 + 5], b[2000 + 5], ans;
long long suma[2000 + 5], sumb[2000 + 5], x, mina[2000 + 5], minb[2000 + 5],
    sum;
int main(void) {
  n = read_int();
  m = read_int();
  for (int i = 1; i <= n; ++i) {
    a[i] = read_int();
    suma[i] = suma[i - 1] + a[i];
  }
  for (int i = 1; i <= m; ++i) {
    b[i] = read_int();
    sumb[i] = sumb[i - 1] + b[i];
  }
  x = read_ll();
  fill(mina, mina + 2000 + 5, 0x7fffffff);
  fill(minb, minb + 2000 + 5, 0x7fffffff);
  for (int i = 1; i <= n; i++) {
    sum = 0;
    for (int j = i; j <= n; j++) {
      sum += a[j];
      mina[j - i + 1] = ((mina[j - i + 1]) < (sum) ? (mina[j - i + 1]) : (sum));
    }
  }
  for (int i = 1; i <= m; i++) {
    sum = 0;
    for (int j = i; j <= m; j++) {
      sum += b[j];
      minb[j - i + 1] = ((minb[j - i + 1]) < (sum) ? (minb[j - i + 1]) : (sum));
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (mina[i] * minb[j] <= x) ans = ((ans) > (i * j) ? (ans) : (i * j));
  cout << ans << endl;
  return 0;
}
