var i = 0

fun main(args: Array<String>) {
    val hwkList = readLine()!!.split(" ").map(String::toInt)
    val cList: MutableList<MutableList<Boolean>> = MutableList(hwkList[0]) {
        val x = readLine()!!.toString()
        val list = mutableListOf<Boolean>()
        x.forEach {
            if (it == '#') {
                list.add(true)
            } else {
                list.add(false)
            }
        }
        list
    }
    var res = if (calc(cList) == hwkList[2]) 1 else 0
    res += calcCol(cList, 0, hwkList[2], 9999)
    res += calcRow(cList, 0, hwkList[2])
    println(res)
}

fun calcRow(arg: MutableList<MutableList<Boolean>>, index: Int, k: Int): Int {
    var res = 0
    for (i in index until arg.size) {
        val tmpList = arg.toMutableList()
        tmpList.removeAt(i)
        val calc = calc(tmpList)
        if (calc == k) {
            res++
        }
        if (tmpList.size > 0 && calc >= k) {
            res += calcRow(tmpList, i, k)
            res += calcCol(tmpList, 0, k, i)
        }


    }
    return res
}

fun calcCol(arg: MutableList<MutableList<Boolean>>, index: Int, k: Int, row: Int): Int {
    var res = 0

    for (i in index until arg[0].size) {
        val tmpList = arg.map {
            val tmp = it.toMutableList()
            tmp.removeAt(i)
            tmp
        }.toMutableList()
        val calc = calc(tmpList)
        if (calc == k) {
            res++
        }
        if (calc >= k) {
            res += calcCol(tmpList, i, k, row)
        }


    }
    i++

    return res
}

fun calc(arg: MutableList<MutableList<Boolean>>): Int {
    var res = 0
    arg.forEach { row ->
        row.forEach { cal ->
            if (cal) res++
        }
    }
    i++
    return res
}
