import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
import qualified Data.Vector.Unboxed as VU
import Data.Bits (testBit)

main :: IO ()
main = do
  [h, w, k] <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  let
    decode :: Int -> (Int, Int)
    decode = (`divMod` w)
    count :: (Int, Int) -> VU.Vector Bool -> Int
    count (s, t) = VU.length . VU.ifilter p
      where
        p :: Int -> Bool -> Bool
        p m b = not $ testBit s i || testBit t j || not b
          where
            (i, j) = decode m :: (Int, Int)
    patterns = (,) <$> [0..(2 ^ h - 1)] <*> [0..(2 ^ w - 1)] :: [(Int, Int)]
  css <- sequence . replicate h $ map (== '#') <$> getLine :: IO [[Bool]]
  let
    v = VU.fromList . concat $ css :: VU.Vector Bool
  print . length . filter (== k) . map (flip count v) $ patterns

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
{-# INLINE unsafeTextToInt #-}
