n = gets.to_i
s = gets.chomp.chars
cnt = 0
("0".."9").each do|i|
  ("0".."9").each do|j|
    ("0".."9").each do|k|
      v = i + j + k
      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
  end
end

puts cnt