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

list = s.to_s.split('')

result_list = []
(0..(n - 1)).each do |i1|
  (0..(n - 1)).each do |i2|
    (0..(n - 1)).each do |i3|
      next if i1 >= i2 || i2 >= i3
      text = "#{list[i1]}#{list[i2]}#{list[i3]}"
      result_list.push(text) unless result_list.include?(text)
    end
  end
end

puts result_list.length