#include <bits/stdc++.h>
using namespace std;
long long presuma[2005] = {}, presumb[2005] = {};
long long suma[2005], sumb[2005];
int main(int argc, const char* argv[]) {
  int n, m;
  long long tt;
  scanf("%d%d", &n, &m);
  int tmp = 0;
  for (int i = 1; i <= 2000; i++) suma[i] = sumb[i] = 0x3f3f3f3f;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &tmp);
    presuma[i] = presuma[i - 1] + tmp;
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", &tmp);
    presumb[i] = presumb[i - 1] + tmp;
  }
  scanf("%lld", &tt);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++)
      suma[i] = min(presuma[j] - presuma[j - i], suma[i]);
  }
  for (int i = 1; i <= m; i++) {
    for (int j = i; j <= m; j++)
      sumb[i] = min(presumb[j] - presumb[j - i], sumb[i]);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if ((long long)suma[i] * sumb[j] > tt) break;
      ans = max(i * j, ans);
    }
  }
  cout << ans << endl;
}
