#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using i64 = int64_t; using i32 = int32_t; int main() { i64 n, m, k; char op; cin >> n >> m >> k >> op; vector a(n), b(m); for (int i = 0; i < m; ++i) cin >> b[i]; for (int i = 0; i < n; ++i) cin >> a[i]; sort(begin(b), end(b)); i64 ans = 0; for (int i = 0; i < n; ++i) { i64 x = op == '+' ? k - a[i] : (k + a[i] - 1) / a[i]; auto it = lower_bound(begin(b), end(b), x); ans += end(b) - it; } cout << ans << endl; return 0; }