i=0 for c in raw_input(): if c=='+':i+=1 elif c=='/':i/=2 elif c=='^':i*=i else:a print i