#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 7;
int dn[N], dm[N];
int pn[N], pm[N];
int lenn[N], lenm[N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = (1); i < (n + 1); ++i)
    scanf("%d", &dn[i]), pn[i] = pn[i - 1] + dn[i], lenn[i] = 4e9;
  for (int i = (1); i < (m + 1); ++i)
    scanf("%d", &dm[i]), pm[i] = pm[i - 1] + dm[i], lenm[i] = 4e9;
  int x;
  scanf("%d", &x);
  for (int i = (1); i < (n + 1); ++i)
    for (int j = (i); j < (n + 1); ++j)
      lenn[j - i + 1] = min(pn[j] - pn[i - 1], lenn[j - i + 1]);
  for (int i = (1); i < (m + 1); ++i)
    for (int j = (i); j < (m + 1); ++j)
      lenm[j - i + 1] = min(pm[j] - pm[i - 1], lenm[j - i + 1]);
  int ans = 0;
  for (int i = (1); i < (n + 1); ++i)
    for (int j = (1); j < (m + 1); ++j)
      if (1ll * lenn[i] * lenm[j] <= x) ans = max(ans, i * j);
  cout << ans << "\n";
  return 0;
}
