#include <bits/stdc++.h>
using namespace std;
long long n, m;
int32_t main() {
  cin >> n >> m;
  long long a[n + 1], b[m + 1];
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long j = 1; j <= m; j++) cin >> b[j];
  long long k;
  cin >> k;
  long long prea[n + 1], preb[m + 1];
  prea[0] = preb[0] = 0;
  for (long long i = 1; i <= n; i++) {
    prea[i] = prea[i - 1] + a[i];
  }
  for (long long i = 1; i <= m; i++) {
    preb[i] = preb[i - 1] + b[i];
  }
  long long A[n + 1], B[m + 1];
  for (long long i = 0; i <= n; i++) A[i] = INT_MAX;
  for (long long i = 0; i <= m; i++) B[i] = INT_MAX;
  for (long long len = 0; len <= n; len++) {
    for (long long i = 1; i <= n; i++) {
      long long j = i + len;
      if (j > n) continue;
      A[len + 1] = min(A[len + 1], prea[j] - prea[i - 1]);
    }
  }
  for (long long len = 0; len <= m; len++) {
    for (long long i = 1; i <= m; i++) {
      long long j = i + len;
      if (j > m) continue;
      B[len + 1] = min(B[len + 1], preb[j] - preb[i - 1]);
    }
  }
  long long s = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      if (i * j >= s && A[i] * B[j] <= k) {
        s = i * j;
      }
    }
  }
  cout << s;
  return 0;
}
