#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
using ii = pair<int, int>;
using ll = long long;
const int N = 2005;
const int mod = 1e9 + 7;
ll a[2005], b[2005];
ll lena[2005], lenb[2005];
int n, m;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  ll x;
  cin >> x;
  fill(lena, lena + n + 1, 1e9);
  fill(lenb, lenb + m + 1, 1e9);
  for (int i = 0; i < n; i++) {
    ll cur = 0;
    for (int j = i; j < n; j++) {
      cur += a[j];
      lena[j - i + 1] = min(lena[j - i + 1], cur);
    }
  }
  for (int i = 0; i < m; i++) {
    ll cur = 0;
    for (int j = i; j < m; j++) {
      cur += b[j];
      lenb[j - i + 1] = min(lenb[j - i + 1], cur);
    }
  }
  int out = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (lena[i] * lenb[j] <= x) out = max(out, i * j);
  cout << out << "\n";
  return 0;
}
