_n = gets
str = gets

def make_substrings(str, visited = Hash.new { false })
  return [''] if str.empty?
  visited = visited.dup
  first_char = str[0]
  str = str[1..-1]

  candidates = make_substrings(str, visited)
  candidates += if visited[first_char]
                  []
                else
                  visited[first_char] = true
                  a = make_substrings(str, visited)
                  a.map! { |s| first_char + s }
                  a
                end

  candidates
end

puts make_substrings(str.strip).length - 1