#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e3 + 4;
long long n, m;
long long a[maxn], b[maxn];
long long x;
long long minsm[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    minsm[i + 1] = 1e18;
  }
  for (int i = 1; i <= m; ++i) {
    cin >> b[i];
  }
  cin >> x;
  for (int i = 0; i < n; ++i) {
    long long sm = 0;
    for (int j = i; j < n; ++j) {
      sm += a[j];
      minsm[j - i + 1] = min(minsm[j - i + 1], sm);
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    int k = 1;
    long long sm = 0;
    for (int j = 1; j <= m; ++j) {
      while (k <= m and (1ll * (sm + b[k]) * minsm[i]) <= x) {
        sm += b[k];
        k++;
      }
      ans = max(ans, 1ll * (k - j) * i);
      sm -= b[j];
    }
  }
  cout << ans << '\n';
}
