#include <bits/stdc++.h>
using namespace std;
int a[2010], b[2010];
int c[2010 * 2010];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= m; ++i) scanf("%d", &b[i]);
  int X;
  scanf("%d", &X);
  for (int i = 1; i <= m; ++i) {
    int x = 0;
    for (int j = i; j <= m; ++j) {
      x += b[j];
      c[x] = max(c[x], j - i + 1);
    }
  }
  for (int i = 1; i <= 2000 * 2000; ++i) c[i] = max(c[i - 1], c[i]);
  int Ans = 0;
  for (int i = 1; i <= n; ++i) {
    int x = 0;
    for (int j = i; j <= n; ++j) {
      x += a[j];
      int y = X / x;
      if (y > 2000 * 2000) y = 2000 * 2000;
      Ans = max(Ans, c[y] * (j - i + 1));
    }
  }
  printf("%d\n", Ans);
  return 0;
}
