public static void main ( String args [ ] ) {
  Scanner sc = new Scanner ( System . in ) ;
  String s ;
  int n , i , c = 1 , f = 0 ;
  char ch1 , ch2 ;
  s = sc . nextLine ( ) ;
  s = s + " " ;
  n = s . length ( ) ;
  ch1 = s . charAt ( 0 ) ;
  for ( i = 0 ;
  i < n - 1 ;
  i ++ ) {
    if ( c == 1 ) ch1 = s . charAt ( i ) ;
    ch2 = s . charAt ( i + 1 ) ;
    if ( ch1 == ch2 ) c ++ ;
    else {
      if ( c % 2 == 0 ) f ++ ;
      c = 1 ;
    }
  }
  System . out . println ( f ) ;
}

public static void main ( String args [ ] ) { Scanner sc = new Scanner ( System . in ) ; String s ; int n , i , c = 1 , f = 0 ; char ch1 , ch2 ; s = sc . nextLine ( ) ; s = s + " ▁ " ; n = s . length ( ) ; ch1 = s . charAt ( 0 ) ; for ( i = 0 ; i < n - 1 ; i ++ ) { if ( c == 1 ) ch1 = s . charAt ( i ) ; ch2 = s . charAt ( i + 1 ) ; if ( ch1 == ch2 ) c ++ ; else { if ( c % 2 == 0 ) f ++ ; c = 1 ; } } System . out . println ( f ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier) dimensions: (dimensions))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (string_literal)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (for_statement init: (assignment_expression left: (identifier) right: (decimal_integer_literal)) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (update_expression (identifier))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (expression_statement (update_expression (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))