#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
int n, m;
int a[2001], b[2001];
int ma[2001], mb[2001];
int main() {
  scanf("%d%d", &n, &m);
  a[0] = 0, b[0] = 0;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), a[i] += a[i - 1];
  for (int i = 1; i <= m; i++) scanf("%d", &b[i]), b[i] += b[i - 1];
  int x;
  scanf("%d", &x);
  memset(ma, 0x3f, sizeof(ma));
  memset(mb, 0x3f, sizeof(mb));
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < i; j++) ma[i - j] = min(ma[i - j], a[i] - a[j]);
  for (int i = 1; i <= m; i++)
    for (int j = 0; j < i; j++) mb[i - j] = min(mb[i - j], b[i] - b[j]);
  int ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (((long long)ma[i]) * mb[j] <= x)
        ans = max(ans, i * j);
      else
        break;
  printf("%d", ans);
  return 0;
}
