import java.util.*; public class Main { static long cul(String a){ int now=0; long ret = 0; while(now<a.length() && Character.isDigit(a.charAt(now)) ){ now++; } ret=Long.parseLong(a.substring(0, now)); while(now<a.length()){ if(a.charAt(now)=='-'){ now++; int s=now; while(now<a.length() && Character.isDigit(a.charAt(now)) ){ now++; } ret-=Long.parseLong(a.substring(s,now)); }else{ now++; int s=now; while(now<a.length() && Character.isDigit(a.charAt(now)) ){ now++; } ret+=Long.parseLong(a.substring(s,now)); } } return ret; } public static void main(String[] args){ // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); String a = sc.next(); long ans=cul(a); int le = a.length(); a+=a; for(int i=1;i<le;i++){ if(a.substring(i, i+le).indexOf("-")!=0 &&a.substring(i, i+le).indexOf("+")!=0 &&a.substring(i, i+le).lastIndexOf("-")!=(le-1) &&a.substring(i, i+le).lastIndexOf("+")!=(le-1) ){ ans=Math.max(ans, cul(a.substring(i,i+le))); } } System.out.println(ans); } }