#include <bits/stdc++.h>
using namespace std;
long long a[2007], b[2007], sum_a[2007], sum_b[2007], fa[2007], fb[2007];
int max(int x, int y) { return x > y ? x : y; }
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m, x, s = 0;
  memset(fa, 0x3f3f3f3f, sizeof(fa));
  memset(fb, 0x3f3f3f3f, sizeof(fb));
  sum_a[0] = sum_b[0] = 0;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum_a[i] = sum_a[i - 1] + a[i];
  }
  for (int i = 1; i <= m; i++) {
    cin >> b[i];
    sum_b[i] = sum_b[i - 1] + b[i];
  }
  cin >> x;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= n - i; j++) {
      fa[i] = min(fa[i], sum_a[j + i] - sum_a[j]);
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j <= m - i; j++) {
      fb[i] = min(fb[i], sum_b[j + i] - sum_b[j]);
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (fa[i] * fb[j] <= x) {
        s = max(i * j, s);
      }
    }
  }
  cout << s;
  return 0;
}
