puts gets.chomp.split('').permutation.map(&:join).uniq.size - 1