import scala.io.StdIn object Problem170 { def proc(s: String): Int = s.permutations.length - 1 def main(args: Array[String]) { val S = StdIn.readLine() val result: Int = proc(S) println(result) } }