require 'set'

n = gets.chomp.to_i
s = gets.chomp

keys = Set.new
(0...n).each do |i|
  (i+1...n).each do |j|
    (j+1...n).each do |k|
      keys << "#{s[i]}#{s[j]}#{s[k]}"
    end
  end
end

puts keys.size
