t='' d=0 for c in raw_input():e='0('.find(c);d+=e;t+=[`d`,c][e] print t