#include #include #include #include #include using namespace std; int main() { int N, M, K; string op; cin >> N >> M >> K >> op; vector B(M), A(N); for (int i = 0; i < M; ++i) cin >> B[i]; for (int i = 0; i < N; ++i) cin >> A[i]; sort(A.begin(), A.end()); sort(B.begin(), B.end()); long long ans = 0; for (int i = 0; i < N; ++i) { int least = (op == "+" ? K - A[i] : (K + A[i] - 1) / A[i]); ans += B.end() - lower_bound(B.begin(), B.end(), least); } cout << ans << endl; return 0; }