n = gets.to_i
s = gets.chomp.chars
cnt = 0
vs = []
("0".."9").each do|i|
  ("0".."9").each do|j|
    ("0".."9").each do|k|
      vs << i + j + k
    end
  end
end
vs.each do |v|
  que = v.split("")
  s.each do |c|
    if c == que[0]
      que.shift
    end
    break if que.empty?
  end
  cnt += 1 if que.empty?
end

puts cnt