#include using namespace std; int main() { int N, M, K; cin >> N >> M >> K; char op; cin >> op; vector B(M), A(N); for(auto &e : B) cin >> e; for(auto &e : A) cin >> e; sort(B.begin(), B.end()); auto f = [&](int64_t a, int64_t b) -> int64_t { return op == '+' ? a + b : a * b; }; int64_t ans = 0; for(int i = 0; i < N; ++i) { auto OK = [&](int x) -> bool { return f(A[i], B[x - 1]) < K; }; int l = 0, r = M + 1; while(r - l > 1) { int c = (l + r) / 2; if(OK(c)) l = c; else r = c; } ans += M - l; } cout << ans << '\n'; return 0; }