typedef long long ll; #include using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); ll n,m,k; std::cin >> n>>m>>k; char op; std::cin >> op; vector a(n),b(m); for (int i = 0; i < m; i++) { std::cin >> b[i]; } for (int i = 0; i < n; i++) { std::cin >> a[i]; } sort(a.begin(),a.end()); sort(b.begin(),b.end()); ll ans = 0; for (int i = 0; i < n; i++) { if(op=='+'){ ans += m-distance(b.begin(),lower_bound(b.begin(),b.end(),k-a[i])); }else{ ll r = m; ll l = -1; while(r-l>1){ ll mid = (r+l)/2; if(b[mid]*a[i]>=k){ r = mid; }else{ l = mid; } } ans += m-r; } } std::cout << ans << std::endl; }