public static void main ( String [ ] args ) throws IOException {
  in . readLine ( ) ;
  String s = in . readLine ( ) ;
  if ( s . length ( ) > 26 ) {
    out . print ( - 1 ) ;
  }
  else {
    int repetitions = 0 ;
    List < Character > abc = new ArrayList < > ( ) ;
    char [ ] letters = s . toCharArray ( ) ;
    for ( char letter : letters ) {
      if ( abc . contains ( letter ) ) {
        repetitions ++ ;
      }
      else {
        abc . add ( letter ) ;
      }
    }
    out . print ( repetitions ) ;
  }
  out . close ( ) ;
}

public static void main ( String [ ] args ) throws IOException { in . readLine ( ) ; String s = in . readLine ( ) ; if ( s . length ( ) > 26 ) { out . print ( - 1 ) ; } else { int repetitions = 0 ; List < Character > abc = new ArrayList < > ( ) ; char [ ] letters = s . toCharArray ( ) ; for ( char letter : letters ) { if ( abc . contains ( letter ) ) { repetitions ++ ; } else { abc . add ( letter ) ; } } out . print ( repetitions ) ; } out . 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 (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (unary_expression operand: (decimal_integer_literal)))))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (generic_type (type_identifier) (type_arguments (type_identifier))) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (generic_type (type_identifier) (type_arguments)) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (identifier) body: (block (if_statement condition: (parenthesized_expression (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) consequence: (block (expression_statement (update_expression (identifier)))) alternative: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))