#include using namespace std; int main() { int64_t n, m, k; cin >> n >> m >> k; char op; cin >> op; vector b(m); for(int i = 0; i < m; ++i) cin >> b[i]; vector a(n); for(int i = 0; i < n; ++i) cin >> a[i]; sort(b.begin(), b.end()); int64_t ans = 0; if(op == '+') { for(int i = 0; i < n; ++i) { ans += b.end() - lower_bound(b.begin(), b.end(), k - a[i]); } } else { for(int i = 0; i < n; ++i) { ans += b.end() - lower_bound(b.begin(), b.end(), (k + a[i] - 1) / a[i]); } } cout << ans << '\n'; return 0; }