#include <bits/stdc++.h>
using namespace std;
long long n, m, k, a[2002], b[2002], x[2002], y[2002];
long long c[2002], d[2002], f[2002][2002], ans = 0;
int main() {
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) cin >> a[i], x[i] = x[i - 1] + a[i];
  for (long long i = 1; i <= m; i++) cin >> b[i], y[i] = y[i - 1] + b[i];
  cin >> k;
  for (long long i = 1; i <= n; i++) {
    c[i] = 1e18;
    for (long long j = 1; j <= n - i + 1; j++) {
      c[i] = min(c[i], x[j + i - 1] - x[j - 1]);
    }
  }
  for (long long i = 1; i <= m; i++) {
    d[i] = 1e18;
    for (long long j = 1; j <= m - i + 1; j++) {
      d[i] = min(d[i], y[j + i - 1] - y[j - 1]);
    }
  }
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) {
      if (c[i] * d[j] <= k) {
        ans = max(ans, i * j);
      }
    }
  cout << ans;
}
