_n = gets
str = gets

def make_substrings(str)
  return [''] if str.empty?
  visited = visited.dup
  first_char = str[0]
  str = str[1..-1]

  candidates = make_substrings(str)

  str.gsub!(first_char, '')
  candidates += make_substrings(str).map { |s| first_char + s }

  candidates
end

puts make_substrings(str.strip).length - 1
