#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 1e5 + 10;
const int M = 1e6 + 10;
int a[N], b[N];
int acnt[N], bcnt[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int j = 1; j <= m; ++j) cin >> b[j];
  for (int i = 1; i <= n; ++i) {
    int cnt = 0;
    while (a[i]) acnt[i++] = ++cnt;
  }
  for (int i = 1; i <= m; ++i) {
    int cnt = 0;
    while (b[i]) bcnt[i++] = ++cnt;
  }
  sort(acnt + 1, acnt + n + 1);
  sort(bcnt + 1, bcnt + 1 + m);
  long long ans = 0;
  for (int i = 1; i * i <= k; ++i) {
    if (i * i == k) {
      long long ans1 = n - (lower_bound(acnt + 1, acnt + n + 1, i) - acnt - 1);
      long long ans2 =
          m - (lower_bound(bcnt + 1, bcnt + 1 + m, k / i) - bcnt - 1);
      ans += ans1 * ans2;
    } else if (k % i == 0) {
      long long ans1 = n - (lower_bound(acnt + 1, acnt + n + 1, i) - acnt - 1);
      long long ans2 =
          m - (lower_bound(bcnt + 1, bcnt + 1 + m, k / i) - bcnt - 1);
      ans += ans1 * ans2;
      ans1 = n - (lower_bound(acnt + 1, acnt + n + 1, k / i) - acnt - 1);
      ans2 = m - (lower_bound(bcnt + 1, bcnt + 1 + m, i) - bcnt - 1);
      ans += ans1 * ans2;
    }
  }
  cout << ans << "\n";
  return 0;
}
