#include <bits/stdc++.h>
using namespace std;
long long n, m;
long long cA[2345], cB[2345];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  long long a[n];
  long long b[m];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < m; i++) {
    cin >> b[i];
  }
  long long x;
  cin >> x;
  for (long long i = 0; i < 2345; i++) {
    cA[i] = 2000000007;
  }
  cA[0] = 0;
  for (long long i = 0; i < n; i++) {
    long long atual = 0;
    for (long long j = i; j < n; j++) {
      atual += a[j];
      cA[j - i + 1] = min(cA[j - i + 1], atual);
    }
  }
  for (long long i = 0; i < 2345; i++) {
    cB[i] = 2000000007;
  }
  cB[0] = 0;
  for (long long i = 0; i < m; i++) {
    long long atual = 0;
    for (long long j = i; j < m; j++) {
      atual += b[j];
      cB[j - i + 1] = min(cB[j - i + 1], atual);
    }
  }
  long long res = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      if (cA[i] * cB[j] <= x) {
        res = max(res, i * j);
      }
    }
  }
  cout << res << endl;
}
