_n = gets
str = gets

def count(str, h = {})
  return 2 if str.length == 1
  return h[str] if h[str]
  
  str2 = str.chars.reject { |c| str[0] == c }.join('')
  h[str] = if str2.length > 0
             count(str[1..-1], h) + count(str2, h)
           else
             count(str[1..-1], h) + 1
           end
end

puts count(str.strip) - 1