n = gets.to_i
s = gets.chomp

ans = 0

('0'..'9').to_a.repeated_combination(3).to_a.each do |x|
  now = 0
  n.times do |t|
    now += 1 if x[now] == s[t]
    break if now == 3
  end
  ans += 1 if now == 3
end

puts ans
