//No.193 筒の数式 import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.lang.Math.*; public class No0193 { static final Scanner in = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static void solve() { String s = in.next(); int len = s.length(); s = s + s; int res = -1; for (int i=len; i<2*len; i++) { if (s.charAt(i-1) != '-' && s.charAt(i-1) != '+' && s.charAt(i-len) != '-' && s.charAt(i-len) != '+') res = max(res,calc(s,i-len,i)); } out.println(res); } static int calc(String s,int x, int y) { int res = 0, t = 0, f = 0; for (int i=x; i