#include #include #include #include using namespace std; using namespace atcoder; using namespace __gnu_pbds; using ll=long long; using ld=long double; using vll=vector; using vvll=vector; using pll=pair; // using mint=modint; // template // using ordered_map=tree,rb_tree_tag,tree_order_statistics_node_update>; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll N,M,K; cin>>N>>M>>K; string op; cin>>op; vll B(M); for(int i=0;i>B[i]; sort(B.begin(),B.end()); ll ans=0; for(int i=0;i>A; if(A>=K){ ans+=B.size(); continue; } ll need; if(op=="+"){ need=K-A; }else{ need=K/A; if(need*A