n=gets.to_i
s=gets.chomp
array=s.split("")
class Array
  def beki
    ret = []
    0.upto(2**size - 1) { |n|
      a = []
      each { |i|
        a.push i if n & 1 == 1
        n >>= 1
      }
      ret.push a
    }
    ret
  end
end
brray = array.beki
crray = brray.select{ |x| x == x.uniq }.map
puts crray.count