string@S;ll N=S.size(),c[N],L=0;REP[S,i](s,N)s<61?c[L++]=0:s>61?L&&c[--L]?N-=c[L]+2:N:L?++c[L-1]:N;wt(N);