#yuki_297 import sys n=int(raw_input()) s=raw_input().split() s.sort() plus=s.count('+') minus=s.count('-') pm=plus+minus tt=s[pm:] t=tt[:] mns=minus pls=plus f="" i=0 while mns>0: f+=t[i]+'-' mns-=1 i+=1 while pls>0: f+=t[i]+'+' pls-=1 i+=1 while i0: f="" for i in xrange(plus+1): f+='+' for j in xrange(len(t)/(plus+1)+1): if i+j*(plus+1)>=len(t): break f=f+t[i+j*(plus+1)] f=f.replace('0','') print eval(f) sys.exit() i=0 f="" while i