n = gets.chomp.to_i
s = gets.chomp.split(//)

left = [s.first]
a = []
right = s.slice(2,n)

1.upto(n-2).each do |i|
  # p [left, s[i], right]
  left.uniq.each do |l|
    right.uniq.each do |r|
      a.push l + s[i] + r
    end
  end

  left.push s[i]
  right.shift
end

puts a.uniq.size