#include using namespace std; typedef long long ll; #define rep(i,n) for(int i=0; i<(n); i++) 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; } int main(){ 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(a.begin(), a.end()); sort(b.begin(), b.end()); if(op=='+'){ ll res=0; rep(i,n){ auto Iter=lower_bound(b.begin(), b.end(), k-a[i]); res+=b.end()-Iter; } cout<