#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e15;
long long a[2005], b[2005];
long long sum1[2005], sum2[2005];
long long n, m, k;
bool check(long long x) {
  if (x == 0) return true;
  for (int i = 1; i <= min(n, x); i++) {
    if (x % i == 0 && x / i <= m) {
      long long j = x / i;
      if (a[i] * b[j] <= k) {
        return true;
      }
    }
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  a[0] = b[0] = 0;
  for (int i = 1; i <= max(n, m); i++) {
    a[i] = b[i] = inf;
  }
  for (int i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    sum1[i] = sum1[i - 1] + x;
    for (int j = 1; j <= i; j++) {
      a[i - j + 1] = min(a[i - j + 1], sum1[i] - sum1[j - 1]);
    }
  }
  for (int i = 1; i <= m; i++) {
    long long x;
    cin >> x;
    sum2[i] = sum2[i - 1] + x;
    for (int j = 1; j <= i; j++) {
      b[i - j + 1] = min(b[i - j + 1], sum2[i] - sum2[j - 1]);
    }
  }
  long long ans = 0;
  cin >> k;
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++)
      if (a[i] * b[j] <= k) ans = max(ans, i * j);
  cout << ans << endl;
}
