#include <bits/stdc++.h>
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long int n, m;
  cin >> n >> m;
  vector<long long int> a(n), b(m);
  vector<long long int> A(n + 1);
  vector<long long int> B(m + 1);
  vector<long long int> sumA(n + 1), sumB(m + 1);
  long long int x;
  for (int i = int(0); i < int(n); i++) cin >> a[i];
  for (int i = int(0); i < int(m); i++) cin >> b[i];
  cin >> x;
  for (int i = int(0); i < int(n); i++) {
    sumA[i + 1] = sumA[i] + a[i];
  }
  for (int i = int(0); i < int(m); i++) {
    sumB[i + 1] = sumB[i] + b[i];
  }
  for (int j = 1; j <= n; ++j) {
    long long int min_v = (long long int)5e15;
    for (int i = j; i <= n; ++i) {
      chmin(min_v, sumA[i] - sumA[i - j]);
    }
    A[j] = min_v;
  }
  for (int j = 1; j <= m; ++j) {
    long long int min_v = (long long int)5e15;
    for (int i = j; i <= m; ++i) {
      chmin(min_v, sumB[i] - sumB[i - j]);
    }
    B[j] = min_v;
  }
  long long int ans = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (A[i] * B[j] <= x) {
        chmax(ans, i * j);
      }
    }
  }
  cout << ans << endl;
  return 0;
}
