#include <bits/stdc++.h>
using namespace std;
long long a[2005], b[2005], A[2005], B[2005];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, x, ans = 0;
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] += a[i - 1];
    A[i] = a[i];
    for (long long j = 1; j < i; j++) {
      A[i - j] = min(A[i - j], a[i] - a[j]);
    }
  }
  for (long long i = 1; i <= m; i++) {
    cin >> b[i];
    b[i] += b[i - 1];
    B[i] = b[i];
    for (int j = 1; j < i; j++) {
      B[i - j] = min(B[i - j], b[i] - b[j]);
    }
  }
  cin >> x;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      if (A[i] * 1LL * B[j] <= x) {
        ans = max(ans, i * j);
      }
    }
  }
  cout << ans;
}
