#include using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef pair P; int main(){ int 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 res = 0; for (int i = 0; i < n; i++) { int x = (op == '+' ? k - a[i] : (k + a[i] - 1) / a[i]); auto cnt = lower_bound(b.begin(), b.end(), x) - b.begin(); res += (m - cnt); } cout << res << endl; return 0; }