#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma G++ optimize("O3")
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
const int maxn = 4e4 + 7;
const int maxm = 1e5 + 7;
const int mod = 1e7 + 9;
long long a[maxn], b[maxn];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  int n, m, k;
  cin >> n >> m >> k;
  memset((a), (0), sizeof(a));
  memset((b), (0), sizeof(b));
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    if (a[i]) a[i] += a[i - 1];
  }
  for (int i = 1; i <= m; ++i) {
    cin >> b[i];
    if (b[i]) b[i] += b[i - 1];
  }
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    if (k % i == 0) {
      long long num1 = 0, num2 = 0;
      for (int j = 1; j <= n; ++j) {
        if (a[j] >= i) num1++;
      }
      for (int j = 1; j <= m; ++j) {
        if (b[j] >= k / i) num2++;
      }
      ans += num1 * num2;
    }
  }
  cout << ans << endl;
  return 0;
}
