public static void main ( String [ ] args ) throws Exception {
  br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
  pw = new PrintWriter ( new BufferedWriter ( new FileWriter ( "b.out" ) ) ) ;
  final int MAX_CASES = readInt ( ) ;
  for ( int casenum = 1 ;
  casenum <= MAX_CASES ;
  casenum ++ ) {
    pw . printf ( "Case #%d: " , casenum ) ;
    String s = nextToken ( ) ;
    boolean [ ] good = new boolean [ s . length ( ) ] ;
    int ret = 0 ;
    boolean last = true ;
    for ( int i = 0 ;
    i < good . length ;
    i ++ ) {
      good [ i ] = s . charAt ( i ) == '+' ;
      if ( i > 0 && last != good [ i ] ) {
        ret ++ ;
      }
      last = good [ i ] ;
    }
    if ( ! last ) ret ++ ;
    pw . println ( ret ) ;
  }
  pw . close ( ) ;
}

public static void main ( String [ ] args ) throws Exception { br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; pw = new PrintWriter ( new BufferedWriter ( new FileWriter ( " b . out " ) ) ) ; final int MAX_CASES = readInt ( ) ; for ( int casenum = 1 ; casenum <= MAX_CASES ; casenum ++ ) { pw . printf ( " Case ▁ # % d : ▁ " , casenum ) ; String s = nextToken ( ) ; boolean [ ] good = new boolean [ s . length ( ) ] ; int ret = 0 ; boolean last = true ; for ( int i = 0 ; i < good . length ; i ++ ) { good [ i ] = s . charAt ( i ) == ' + ' ; if ( i > 0 && last != good [ i ] ) { ret ++ ; } last = good [ i ] ; } if ( ! last ) ret ++ ; pw . println ( ret ) ; } pw . close ( ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (string_literal))))))))) (local_variable_declaration (modifiers) type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal) (identifier)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (boolean_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (boolean_type) dimensions: (dimensions_expr (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (identifier))))) consequence: (block (expression_statement (update_expression (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))))) (if_statement condition: (parenthesized_expression (unary_expression operand: (identifier))) consequence: (expression_statement (update_expression (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))