#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); ll n, m, k; cin >> n >> m >> k; char op; cin >> op; vector a(n), b(m); rep(i, m) cin >> b[i]; rep(i, n) cin >> a[i]; sort(b.begin(), b.end()); ll ans = 0; rep(i, n) { auto it = lower_bound(b.begin(), b.end(), op == '+' ? k - a[i] : (k + a[i] - 1) / a[i]); ans += b.end() - it; } cout << ans << '\n'; return 0; }