fun main(args:Array<String>?): Unit {
    val s = readLine()!!.trim()
    val counts = ('a' .. 'z').map{c -> s.count{it == c}}.toIntArray()
    if (counts.count{it % 2 == 1} <= 1){
        val n = s.length / 2
        counts.indices.forEach{counts[it] /= 2}
        if (n == 0) println(1)
        else println((n.toLong() downTo 1).reduce { acc: Long, l: Long ->
            var res = acc * l
            for (i in counts.indices) {
                if (counts[i] != 0 && res % counts[i] == 0L) {
                    res /= counts[i]
                    counts[i]--
                }
            }
            res
        })
    }else {
        println(0)
    }
}
