#include using namespace std; using lint = long long; const lint inf = 1LL << 60; const lint mod = 1000000007; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); lint n, m, k; cin >> n >> m >> k; string op; cin >> op; vector b(m), a(n); for (int i = 0; i < m; ++i) { cin >> b[i]; } sort(b.begin(), b.end()); for (int i = 0; i < n; ++i) { cin >> a[i]; } lint ret = n * m; for (int i = 0; i < n; ++i) { if (op == "+") { ret -= lower_bound(b.begin(), b.end(), double(k) - a[i] - 1e-10) - b.begin(); } else { ret -= lower_bound(b.begin(), b.end(), double(k) / a[i] - 1e-10) - b.begin(); } } cout << ret << "\n"; return 0; }