N=int(input()) A=list(input().split()) A_num=[] A_sym=[1] for i in range(N): if A[i]=="+": A_sym.append(1) elif A[i]=="-": A_sym.append(0) else: A_num.append(int(A[i])) num=(N+1)//2 ans=0 for i in range(num): if A_sym[i]==1: ans+=A_num[i] else: ans-=A_num[i] print(ans)