static int TotalPressedCharacter ( int x ) {
  String cha = String . valueOf ( x ) ;
  int count = 0 ;
  for ( int n = 0 ;
  n < cha . length ( ) ;
  n ++ ) {
    if ( n == 0 ) {
      count = 1 ;
    }
    else if ( n == 1 ) {
      count = count + 2 ;
    }
    else if ( n == 2 ) {
      count = count + 3 ;
    }
    else if ( n == 3 ) {
      count = count + 4 ;
    }
  }
  return count ;
}

static int TotalPressedCharacter ( int x ) { String cha = String . valueOf ( x ) ; int count = 0 ; for ( int n = 0 ; n < cha . length ( ) ; n ++ ) { if ( n == 0 ) { count = 1 ; } else if ( n == 1 ) { count = count + 2 ; } else if ( n == 2 ) { count = count + 3 ; } else if ( n == 3 ) { count = count + 4 ; } } return count ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))))))))))) (return_statement (identifier))))