implicit none
integer :: n
integer :: i,j,k
integer(8) :: ans, m(5)
character(10) :: s

m(:) = 0
read *,n
do i = 1, n
   read *,s
   if (s(1:1) == 'M') then
      m(1) = m(1) + 1
   else if (s(1:1) == 'A') then
      m(2) = m(2) + 1
   else if (s(1:1) == 'R') then
      m(3) = m(3) + 1
   else if (s(1:1) == 'C') then
      m(4) = m(4) + 1
   else if (s(1:1) == 'H') then
      m(5) = m(5) + 1
   endif
enddo

ans = 0
do i = 1, 3
   do j = i+1,4
      do k = j+1,5
         ans = ans + m(i)*m(j)*m(k)
      enddo
   enddo
enddo

print '(i0)',ans
end