{-# LANGUAGE TypeApplications #-}

-- | C - H and V
module Main where

import Control.Monad (join, filterM)

main :: IO ()
main = do
  (h : w : k : _) <- map (read @Int) . words <$> getLine
  board <- index h w . lines <$> getContents
  let rows = powerset [1 .. h]
  let cols = powerset [1 .. w]
  let pattern = [(row, col) | row <- rows, col <- cols]
  print $ length $ filter (== k) $ (countBlack . flip repaint board) <$> pattern
  where
    powerset :: [a] -> [[a]]
    powerset xs = filterM (\x -> [True, False]) xs

    index :: Int -> Int -> [[a]] -> [(Int, [(Int, a)])]
    index h w mtx = zip [1 .. h] (zip [1 .. w] <$> mtx)

    repaint :: ([Int], [Int]) -> [(Int, [(Int, a)])] -> [[a]]
    repaint (rs, cs) = map (deindex . dropIdxIn cs) . (deindex . dropIdxIn rs)

    deindex :: [(Int, a)] -> [a]
    deindex = map snd

    dropIdxIn :: [Int] -> [(Int, a)] -> [(Int, a)]
    dropIdxIn is = filter $ \(i, _) -> not (elem i is)

    countBlack :: [String] -> Int
    countBlack = length . filter (== '#') . join
