#include <bits/stdc++.h>
using namespace std;
int inf = 1000000009;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, k, l, p;
  cin >> n >> m;
  long long a[n + 2], b[m + 2], sum = 0, ans = -1;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int j = 0; j < m; j++) cin >> b[j];
  long long d[2005] = {}, e[2005] = {};
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = i; j < n; j++) {
      sum += a[j];
      if (d[j - i + 1] == 0 || d[j - i + 1] > sum) d[j - i + 1] = sum;
    }
  }
  for (int i = 0; i < m; i++) {
    int sum = 0;
    for (int j = i; j < m; j++) {
      sum += b[j];
      if (e[j - i + 1] == 0 || e[j - i + 1] > sum) e[j - i + 1] = sum;
    }
  }
  long long x;
  cin >> x;
  long long mi = 0;
  for (int i = 1; i <= 2000; i++)
    for (int j = 1; j <= 2000; j++)
      if (i * j > mi && d[i] * e[j] <= x && d[i] * e[j] > 0) {
        mi = i * j;
      }
  cout << mi;
}
