(defn luckyPin [n s]
  (->> 
   (for [i (range (count s))
         j (range (count s))
         k (range (count s))
         :when (and (> i j) (> j k))]
     (+ (* 100 (Character/digit (get s i) 10))
        (* 10 (Character/digit (get s j) 10))
        (Character/digit (get s k) 10)))
   (distinct)
   (count)))

(println (luckyPin (read-line) (read-line)))