#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, M; cin >> N >> M; int64_t K; cin >> K; char op; cin >> op; vector B(M); for (auto&& e : B) { cin >> e; } sort(B.begin(), B.end()); int64_t res = 0; for (int i = 0; i < N; i++) { int64_t a; cin >> a; int64_t x = K; if (op == '+') { x -= a; int p = lower_bound(B.begin(), B.end(), x) - B.begin(); res += M - p; } else { int lo = 0, hi = M; while (lo < hi) { int mi = (lo + hi) / 2; if (K <= B[mi] * a) { hi = mi; } else { lo = mi + 1; } } res += M - hi; } } cout << res << '\n'; return 0; }