public static void main ( String [ ] args ) {
  int n = scanner . nextInt ( ) , ans = 0 , colors [ ] = new int [ 9 ] ;
  for ( int i = 0 , temp ;
  i < n ;
  i ++ ) if ( ++ colors [ temp = Color . getColor ( scanner . nextInt ( ) ) . ordinal ( ) ] == 1 && temp != 8 ) ans ++ ;
  System . out . println ( Math . max ( 1 , ans ) + " " + ( ans + colors [ 8 ] ) ) ;
}

public static void main ( String [ ] args ) { int n = scanner . nextInt ( ) , ans = 0 , colors [ ] = new int [ 9 ] ; for ( int i = 0 , temp ; i < n ; i ++ ) if ( ++ colors [ temp = Color . getColor ( scanner . nextInt ( ) ) . ordinal ( ) ] == 1 && temp != 8 ) ans ++ ; System . out . println ( Math . max ( 1 , ans ) + " ▁ " + ( ans + colors [ 8 ] ) ) ; }
(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 object: (identifier) name: (identifier) arguments: (argument_list))) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (update_expression (array_access array: (identifier) index: (assignment_expression left: (identifier) right: (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) name: (identifier) arguments: (argument_list))))) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (expression_statement (update_expression (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal) (identifier))) right: (string_literal)) right: (parenthesized_expression (binary_expression left: (identifier) right: (array_access array: (identifier) index: (decimal_integer_literal))))))))))