public static void main ( String [ ] args ) {
  int n = nextInt ( ) ;
  int [ ] ar = nextIntArray ( n ) ;
  Arrays . sort ( ar ) ;
  long sum = 0 ;
  long notTenMultiple = - 1 ;
  for ( int i = n - 1 ;
  i >= 0 ;
  i -- ) {
    sum += ar [ i ] ;
    if ( ar [ i ] % 10 != 0 ) {
      notTenMultiple = ar [ i ] ;
    }
  }
  if ( notTenMultiple == - 1 ) System . out . println ( 0 ) ;
  else if ( sum % 10 != 0 ) System . out . println ( sum ) ;
  else System . out . println ( sum - notTenMultiple ) ;
}

public static void main ( String [ ] args ) { int n = nextInt ( ) ; int [ ] ar = nextIntArray ( n ) ; Arrays . sort ( ar ) ; long sum = 0 ; long notTenMultiple = - 1 ; for ( int i = n - 1 ; i >= 0 ; i -- ) { sum += ar [ i ] ; if ( ar [ i ] % 10 != 0 ) { notTenMultiple = ar [ i ] ; } } if ( notTenMultiple == - 1 ) System . out . println ( 0 ) ; else if ( sum % 10 != 0 ) System . out . println ( sum ) ; else System . out . println ( sum - notTenMultiple ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (identifier))))) (expression_statement (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))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (unary_expression operand: (decimal_integer_literal)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (unary_expression operand: (decimal_integer_literal)))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier)))) alternative: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))))))))