_n = gets
str = gets

def make_substrings(str)
  return [nil] if str.empty?
  first_char = str[0]
  candidates = make_substrings(str[1..-1])
  str = str.chars.reject { |c| first_char == c }.join('')
  candidates + make_substrings(str)
end

puts make_substrings(str.strip).length - 1