#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; } else { x /= a; } int p = lower_bound(B.begin(), B.end(), x) - B.begin(); res += M - p; } cout << res << '\n'; return 0; }