#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const long long inf = 1000000000000;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<long long> v1(n), v2(m);
  vector<long long> vp1(n + 1), vp2(m + 1);
  vp1[0] = 0;
  vp2[0] = 0;
  for (int i = 0; i < n; i++) {
    cin >> v1[i];
    vp1[i + 1] = vp1[i] + v1[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> v2[i];
    vp2[i + 1] = vp2[i] + v2[i];
  }
  long long x;
  cin >> x;
  long long mini1[n + 1];
  long long mini2[m + 1];
  for (int i = 0; i <= n; i++) {
    mini1[i] = inf;
  }
  for (int i = 0; i <= m; i++) {
    mini2[i] = inf;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (j - i >= 0) mini1[i] = min(mini1[i], vp1[j] - vp1[j - i]);
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= m; j++) {
      if (j - i >= 0) mini2[i] = min(mini2[i], vp2[j] - vp2[j - i]);
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (mini2[j] * mini1[i] <= x) {
        ans = max(ans, (long long)i * j);
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
