#include #include #include #include #include using namespace std; using ll=long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; string s; cin>>n>>s; ll inf=1e18; int b=50; vector dp(b,-inf); dp[0]=0; for(int i=0;i ndp(b,-inf); if(s[i]!='-'){ for(int j=0;j0)ndp[j]=max(ndp[j],dp[j]-1); if(j0)ndp[j]=max(ndp[j],dp[j]+1); }else{ if(dp[j]>0)ndp[j]=max(ndp[j],dp[j]-1); if(j=0){ cout<<(i+1)/2<