#include <bits/stdc++.h>
using namespace std;
int n, m;
long long aa[2003], bb[2003], a[2003], b[2003], x;
template <typename T>
void checkmin(T &a, T b) {
  if (b < a) a = b;
}
template <typename T>
void checkmax(T &a, T b) {
  if (b > a) a = b;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    aa[i] = 21000000000000;
  }
  for (int i = 1; i <= m; ++i) {
    bb[i] = 21000000000000;
  }
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &a[i]);
    a[i] += a[i - 1];
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%lld", &b[i]);
    b[i] += b[i - 1];
  }
  scanf("%lld", &x);
  for (int i = 1; i <= n; ++i) {
    for (int j = i; j <= n; ++j) {
      checkmin(aa[j - i + 1], a[j] - a[i - 1]);
    }
  }
  for (int i = 1; i <= m; ++i) {
    for (int j = i; j <= m; ++j) {
      checkmin(bb[j - i + 1], b[j] - b[i - 1]);
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (aa[i] * bb[j] <= x) {
        checkmax(ans, i * j);
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
