#include int main() { int N, M; int64_t K; char op; scanf("%d%d%lld %c", &N, &M, &K, &op); std::vector A(N), B(M); for (auto& e: B) scanf("%lld", &e); for (auto& e: A) scanf("%lld", &e); std::sort(A.begin(), A.end()); std::sort(B.begin(), B.end()); B.push_back(1'000'000'000); auto calc{ [&](int64_t a, int64_t b) { if (op == '+') return a + b; else return a * b; } }; int64_t ans{}; int ok{M}; for (auto& e: A) { while (ok > 0 && calc(e, B[ok - 1]) >= K) ok--; ans += M - ok; } printf("%lld\n", ans); return 0; }