let input = readLine()!.split(separator: " ").map { Int($0)! }
let H = input[0]
let W = input[1]
let K = input[2]

enum Square: Character {
    case white = "."
    case black = "#"
}

var c = [[Square]]()
var numberOfBlackSquares = 0
for _ in stride(from: 0, to: H, by: 1) {
    let row = Array(readLine()!).map { Square(rawValue: $0)! }
    c.append(row)
    numberOfBlackSquares += row.filter { $0 == .black }.count
}

// 後でなんかいい名前つける
let hoge = 1 << H
let woo = 1 << W

var dp = Array(repeating: Array(repeating: Optional<Int>.none, count: woo), count: hoge)
dp[0][0] = numberOfBlackSquares

for i in stride(from: 0, to: H, by: 1) {
    for state in stride(from: 0, to: hoge, by: 1) {
        guard state & (1 << i) == 0,
            let value = dp[state][0] else { continue }
        let nextState = state | (1 << i)
        dp[nextState][0] = value - c[i].filter { $0 == .black }.count
    }
}

for j in stride(from: 0, to: W, by: 1) {
    for rowState in stride(from: 0, to: hoge, by: 1) {
        for columnState in stride(from: 0, to: woo, by: 1) {
            guard columnState & (1 << j) == 0,
                let value = dp[rowState][columnState] else { continue }
            let nextColumnState = columnState | (1 << j)
          	// 名前募集中
            var numberOfTemp = 0
            for i in stride(from: 0, to: H, by: 1) {
                if rowState & (1 << i) == 0, c[i][j] == .black {
                    numberOfTemp += 1
                }
            }
            dp[rowState][nextColumnState] = value - numberOfTemp
        }
    }
}

let result = dp.reduce(0) { sum, row in
    sum + row.filter { $0 == K }.count
}
print(result)
