#include using namespace std; #define ALL(x) x.begin(),x.end() #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<bool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b>n>>m>>k; char op;cin>>op; vector b(m),a(n); rep(i,m) cin>>b[i]; rep(i,n) cin>>a[i]; ll cnt=0; sort(ALL(b)); rep(i,n){ ll target=(op=='*'?(k+a[i]-1)/a[i]:k-a[i]); cnt+=b.end()-lower_bound(ALL(b),target); } cout<