N = gets.to_i
S = gets.chomp
passList = []
iList = []
jList = []
kList = []

for i in 0..N-3
  if iList.include?(S[i])
    next
  end
  iList.push(S[i])
  for j in i+1..N-2
    if jList.include?(S[i] + S[j])
      next
    end
    jList.push(S[i] + S[j])
    for k in j+1..N-1
      if kList.include?(S[i] + S[j] + S[k])
        next
      end
      kList.push(S[i] + S[j] + S[k])
      pass = S.slice(i)+S.slice(j)+S.slice(k)
      if !passList.include?(pass)
        passList.push(pass)
      end
    end
  end
end

puts passList.size