a = gets.chomp.split("") a = a.permutation.to_a p a.size - 1