#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(i,a) for(int i=(int)0;i<(int)a;++i) #define pb push_back #define eb emplace_back using ll=long long; constexpr ll mod = 1e9 + 7; constexpr ll INF = 1LL << 60; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } using namespace std; //ここから void solve(){ ll n,m,k; cin>>n>>m>>k; char op; cin>>op; vectorb(m),a(n); rep(i,m)cin>>b[i]; rep(i,n)cin>>a[i]; sort(a.begin(),a.end()); sort(b.begin(),b.end()); ll ans=0; if(op=='+'){ rep(i,n){ ll x=k-a[i]; int pos=b.end()-lower_bound(b.begin(),b.end(),x); ans+=pos; } } else { rep(i,n){ ll x=(k+a[i]-1)/a[i]; int pos=b.end()-lower_bound(b.begin(),b.end(),x); ans+=pos; } } cout<