# coding: utf-8
#MitsuiProCon2019D_LuckyPIN.rb
n = gets.to_i
ss = gets.chomp.chars
sn = (0...ss.size).to_a
numbers = []

#消す組み合わせ
ar = sn.combination(n-3).to_a

ar.each do |aa|
  sr = ss.dup
  aa.each do |bb|
    sr[bb]="X"
  end
  sr.delete("X")
  numbers << sr
end

puts numbers.uniq.size
