#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #define rd_skip() while(*rp++>=48) #define wt(v) ({ulong _z=v;do*--wp=_z%10+48;while(_z/=10);}) typedef unsigned long ulong; int main(){ char*mmap(); char*rp=mmap(0l,1l<<25,1,2,0,0ll); rd_skip(); long h=0,b=0,t=0,d=1,z=1,c; while(c=*rp++,c!='\n'){ long ; if(c=='?'){ --b; }else{ t+=(c=='+'?d:-d); if(t>1); write(1,wp,wbuf+sizeof wbuf-wp); _exit(0); }