public static int process ( String A ) {
  int ampersands = 0 , l = A . length ( ) ;
  while ( A . charAt ( ampersands ) == '&' ) ampersands ++ ;
  int asterisks = 0 ;
  while ( A . charAt ( l - 1 - asterisks ) == '*' ) asterisks ++ ;
  String C = A . substring ( ampersands , l - asterisks ) ;
  if ( C . equals ( "errtype" ) ) return - 1 ;
  else {
    if ( ! parameters . containsKey ( C ) ) return - 1 ;
    int Cx = parameters . get ( C ) ;
    if ( Cx == - 1 ) return - 1 ;
    asterisks += Cx ;
    if ( asterisks >= ampersands ) {
      return asterisks - ampersands ;
    }
    else {
      return - 1 ;
    }
  }
}

public static int process ( String A ) { int ampersands = 0 , l = A . length ( ) ; while ( A . charAt ( ampersands ) == ' & ' ) ampersands ++ ; int asterisks = 0 ; while ( A . charAt ( l - 1 - asterisks ) == ' * ' ) asterisks ++ ; String C = A . substring ( ampersands , l - asterisks ) ; if ( C . equals ( " errtype " ) ) return - 1 ; else { if ( ! parameters . containsKey ( C ) ) return - 1 ; int Cx = parameters . get ( C ) ; if ( Cx == - 1 ) return - 1 ; asterisks += Cx ; if ( asterisks >= ampersands ) { return asterisks - ampersands ; } else { return - 1 ; } } }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (while_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) body: (expression_statement (update_expression (identifier)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (identifier)))) right: (character_literal))) body: (expression_statement (update_expression (identifier)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier)))))) (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_literal)))) consequence: (return_statement (unary_expression operand: (decimal_integer_literal))) alternative: (block (if_statement condition: (parenthesized_expression (unary_expression operand: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (return_statement (unary_expression operand: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (return_statement (unary_expression operand: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (return_statement (binary_expression left: (identifier) right: (identifier)))) alternative: (block (return_statement (unary_expression operand: (decimal_integer_literal)))))))))