public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int num = sc . nextInt ( ) ;
  String sol = sc . next ( ) ;
  sc . close ( ) ;
  String [ ] sols = sol . split ( "" ) ;
  int one = 0 ;
  int two = 0 ;
  int three = 0 ;
  int four = 0 ;
  for ( int i = 0 ;
  i < num ;
  i ++ ) {
    switch ( sols [ i ] ) {
      case "1" : one ++ ;
      break ;
      case "2" : two ++ ;
      break ;
      case "3" : three ++ ;
      break ;
      case "4" : four ++ ;
      break ;
    }
  }
  int [ ] arr = {
    one , two , three , four };
    Arrays . sort ( arr ) ;
    String result = arr [ 3 ] + " " + arr [ 0 ] ;
    System . out . println ( result ) ;
  }
  
public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int num = sc . nextInt ( ) ; String sol = sc . next ( ) ; sc . close ( ) ; String [ ] sols = sol . split ( " " ) ; int one = 0 ; int two = 0 ; int three = 0 ; int four = 0 ; for ( int i = 0 ; i < num ; i ++ ) { switch ( sols [ i ] ) { case "1" : one ++ ; break ; case "2" : two ++ ; break ; case "3" : three ++ ; break ; case "4" : four ++ ; break ; } } int [ ] arr = { one , two , three , four } ; Arrays . sort ( arr ) ; String result = arr [ 3 ] + " ▁ " + arr [ 0 ] ; System . out . println ( result ) ; }
(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: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (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)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (local_variable_declaration type: (array_type element: (type_identifier) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (string_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))) (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))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (switch_expression condition: (parenthesized_expression (array_access array: (identifier) index: (identifier))) body: (switch_block (switch_block_statement_group (switch_label (string_literal)) (expression_statement (update_expression (identifier))) (break_statement)) (switch_block_statement_group (switch_label (string_literal)) (expression_statement (update_expression (identifier))) (break_statement)) (switch_block_statement_group (switch_label (string_literal)) (expression_statement (update_expression (identifier))) (break_statement)) (switch_block_statement_group (switch_label (string_literal)) (expression_statement (update_expression (identifier))) (break_statement)))))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_initializer (identifier) (identifier) (identifier) (identifier)))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (string_literal)) right: (array_access array: (identifier) index: (decimal_integer_literal))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))