public static void main ( String [ ] args ) throws IOException {
  BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
  String str = br . readLine ( ) ;
  ArrayList < Character > chars = new ArrayList < Character > ( ) ;
  int one = 0 ;
  int two = 0 ;
  int n = 0 ;
  chars . add ( str . toCharArray ( ) [ 0 ] ) ;
  for ( char x : str . toCharArray ( ) ) {
    int count = 0 ;
    boolean flag = true ;
    for ( int i = 0 ;
    i < chars . size ( ) ;
    i ++ ) {
      if ( chars . get ( i ) == x ) {
        flag = false ;
      }
    }
    if ( flag || n == 0 ) {
      chars . add ( x ) ;
      for ( char y : str . toCharArray ( ) ) {
        if ( x == y ) count ++ ;
      }
    }
    two += count / 2 ;
    one += count % 2 ;
    n ++ ;
  }
  int minLength = two ;
  if ( one != 0 ) minLength = two / one ;
  minLength *= 2 ;
  if ( one > 0 ) minLength += 1 ;
  System . out . println ( minLength ) ;
}

public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String str = br . readLine ( ) ; ArrayList < Character > chars = new ArrayList < Character > ( ) ; int one = 0 ; int two = 0 ; int n = 0 ; chars . add ( str . toCharArray ( ) [ 0 ] ) ; for ( char x : str . toCharArray ( ) ) { int count = 0 ; boolean flag = true ; for ( int i = 0 ; i < chars . size ( ) ; i ++ ) { if ( chars . get ( i ) == x ) { flag = false ; } } if ( flag || n == 0 ) { chars . add ( x ) ; for ( char y : str . toCharArray ( ) ) { if ( x == y ) count ++ ; } } two += count / 2 ; one += count % 2 ; n ++ ; } int minLength = two ; if ( one != 0 ) minLength = two / one ; minLength *= 2 ; if ( one > 0 ) minLength += 1 ; System . out . println ( minLength ) ; }
(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 (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (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) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (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 (type_identifier))) arguments: (argument_list)))) (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: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) index: (decimal_integer_literal))))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (local_variable_declaration type: (boolean_type) declarator: (variable_declarator name: (identifier) value: (true))) (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (false))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (enhanced_for_statement type: (integral_type) name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (expression_statement (update_expression (identifier)))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (update_expression (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (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))))))