fun main() = Thread(null, ::abc173c, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()

@OptIn(ExperimentalStdlibApi::class)
fun abc173c() {
    val (h, w, k) = readLine()!!.split(' ').map { it.toInt() }
    val grid = Array(h) { readLine()!!.map { it == '#' }.toBooleanArray() }

    var answer = 0

    searchAllPatterns(arrayOf(false, true), h) { chooseHorizontal ->
        searchAllPatterns(arrayOf(false, true), w) { chooseVertical ->
            var count = 0
            for (y in 0 until h) for (x in 0 until w) {
                if (chooseHorizontal[y] && chooseVertical[x] && grid[y][x]) count++
            }
            if (count == k) answer++
        }
    }

    println(answer)
}

@Suppress("SameParameterValue")
private inline fun <reified T> searchAllPatterns(patterns: Array<T>, length: Int, action: (Array<T>) -> Unit) {
    val patternSize = patterns.size
    val pow = (1..length).fold(1L) { acc: Long, _: Int -> acc * patternSize }
    val allPatterns = if (pow in 1..Int.MAX_VALUE) pow.toInt() else error("$pow is too large!")
    for (i in 0 until allPatterns) {
        val array = Array(length) { patterns[0] }
        var div = 1
        for (j in 0 until length) {
            array[length - j - 1] = patterns[(i / div) % patternSize]
            div *= patternSize
        }
        action(array)
    }
}
