#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, k;
  cin >> n >> m >> k;
  char op;
  cin >> op;
  vector<int> a(n), b(m);
  for (int i = 0; i < m; ++i) {
    cin >> b[i];
  }
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(b.begin(), b.end());
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    int need;
    if (op == '+') need = k - a[i];
    else need = (k + a[i] - 1) / a[i];
    ans += m - (lower_bound(b.begin(), b.end(), need) - b.begin());
  }
  cout << ans << '\n';
  return 0;
}