bracket = list(input()) ans = 0 tmp =1 stack = [] for i in range(len(bracket)): if bracket[i] == '(': stack.append(bracket[i]) tmp*=2 elif bracket[i] == '[': stack.append(bracket[i]) tmp*=3 elif bracket[i] == ')': if not stack or stack[-1]!='(': ans =0 break if bracket[i-1] =='(' : ans+=tmp stack.pop() tmp//=2 else: if not stack or stack[-1]!='[': ans =0 break if bracket[i-1] =='[' : ans+=tmp st..