#include using namespace std; typedef long long ll; int main() { int n; cin >> n; vector a,b; for(int i=0; i> c; if(isdigit(c)) a.push_back(c-'0'); else { if(c=='+') b.push_back(1); else b.push_back(-1); } } ll x=0,y=0; //最大値 sort(a.begin(),a.end(),greater()); sort(b.begin(),b.end(),greater()); for(int i=0; i