#include <bits/stdc++.h>
using namespace std;
int ai[2005], bi[2005], mina[2005], minb[2005];
int main() {
  int n, m;
  long long x;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    long long t;
    cin >> t;
    ai[i] = ai[i - 1] + t;
  }
  for (int i = 1; i <= m; i++) {
    long long t;
    cin >> t;
    bi[i] = bi[i - 1] + t;
  }
  cin >> x;
  for (int i = 0; i < 2005; i++) {
    mina[i] = INT_MAX;
    minb[i] = INT_MAX;
  }
  for (int i = 0; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      mina[j - i] = min(mina[j - i], ai[j] - ai[i]);
    }
  }
  for (int i = 0; i <= m; i++) {
    for (int j = i + 1; j <= m; j++) {
      minb[j - i] = min(minb[j - i], bi[j] - bi[i]);
    }
  }
  int ant = INT_MIN, flag = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (mina[i] <= x / minb[j]) {
        ant = max(ant, i * j);
        flag = 1;
      }
    }
  }
  if (flag)
    cout << ant << endl;
  else
    cout << "0" << endl;
  return 0;
}
