program answer
  implicit none
  integer(16) :: i, N, ans
  integer(16) :: count(26)
  character(len=100000) :: S
  
  read(*,*) N
  read(*,*) S
  count=0
  do i = 1, N
     count(ichar(S(i:i))-96)=count(ichar(S(i:i))-96)+1
  end do

  ans=1
  do i = 1, N
     ans=ans*(count(i)+1)
  end do
  ans=ans-1
  write(*,*) ans
  stop
 end program answer