let inp = readLine()!.split(separator: " ").map { Int($0)! }

let H = inp[0]
let W = inp[1]
let K = inp[2]

var grid: [[String]] = .init(repeating: .init(repeating: "", count: W), count: H)
var blacks = 0

for row in 0..<H {
  var black = 0
  grid[row] = readLine()!.map { c in 
                if c == "#" {
                  black += 1
                }
                return String(c) 
              }
  blacks += black
}

func fillRows(_ grid: inout [[String]], _ row: Int) -> Int {
  var diff = 0
  for col in 0..<grid[row].count {
    if grid[row][col] == "#" {
      diff += 1
    }
    grid[row][col] = "@"
  }
  return diff
}
func fillCols(_ grid: inout [[String]], _ col: Int) -> Int {
  var diff = 0
  for row in 0..<grid.count {
    if grid[row][col] == "#" {
      diff += 1
    }
    grid[row][col] = "@"
  }
  return diff
}

func backtrack(_ grid: [[String]], _ row: Int, _ col: Int, _ black: Int) -> Int {
  if row >= grid.count && col >= grid[0].count {
    return black == 0 ? 1 : 0
  }
  let take: Int
  let notTake: Int
  var tmp = grid
  if row < grid.count {
    let diff = fillRows(&tmp, row)
    take = backtrack(tmp, row + 1, col, black - diff)
    notTake = backtrack(grid, row + 1, col, black)
  } else {
    let diff = fillCols(&tmp, col)
    take = backtrack(tmp, row, col + 1, black - diff)
    notTake = backtrack(grid, row, col + 1, black)
  }
  return take + notTake
}
let res = backtrack(grid, 0, 0, blacks - K)
print(res)