public static void main ( String [ ] args ) {
  int n = scanner . nextInt ( ) ;
  long m = 0 , a = 0 , r = 0 , c = 0 , h = 0 ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) {
    switch ( scanner . next ( ) . charAt ( 0 ) ) {
      case 'M' : m ++ ;
      continue ;
      case 'A' : a ++ ;
      continue ;
      case 'R' : r ++ ;
      continue ;
      case 'C' : c ++ ;
      continue ;
      case 'H' : h ++ ;
    }
  }
  System . out . println ( m * a * r + m * a * c + m * a * h + m * r * c + m * r * h + m * c * h + a * r * c + a * r * h + a * c * h + r * c * h ) ;
}

public static void main ( String [ ] args ) { int n = scanner . nextInt ( ) ; long m = 0 , a = 0 , r = 0 , c = 0 , h = 0 ; for ( int i = 0 ; i < n ; i ++ ) { switch ( scanner . next ( ) . charAt ( 0 ) ) { case ' M ' : m ++ ; continue ; case ' A ' : a ++ ; continue ; case ' R ' : r ++ ; continue ; case ' C ' : c ++ ; continue ; case ' H ' : h ++ ; } } System . out . println ( m * a * r + m * a * c + m * a * h + m * r * c + m * r * h + m * c * h + a * r * c + a * r * h + a * c * h + r * c * h ) ; }
(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)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal)) 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 (method_invocation object: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) name: (identifier) arguments: (argument_list (decimal_integer_literal)))) body: (switch_block (switch_block_statement_group (switch_label (character_literal)) (expression_statement (update_expression (identifier))) (continue_statement)) (switch_block_statement_group (switch_label (character_literal)) (expression_statement (update_expression (identifier))) (continue_statement)) (switch_block_statement_group (switch_label (character_literal)) (expression_statement (update_expression (identifier))) (continue_statement)) (switch_block_statement_group (switch_label (character_literal)) (expression_statement (update_expression (identifier))) (continue_statement)) (switch_block_statement_group (switch_label (character_literal)) (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: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier)) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))) right: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))))))))