
--{-# LANGUAGE StandaloneDeriving #-}
--{-# LANGUAGE BangPatterns #-}

module Main where

import Debug.Trace
--import Data.List
--import Data.Char
import qualified Data.Set as Set
--import qualified Data.Map.Strict as Map

main :: IO ()
main = do
  [h, w, k] <- map read . words <$> getLine
  s <- toSet h w . lines <$> getContents
  --a `traceShow`
  print . length $ solve h w k s

toSet :: Int -> Int -> [String] -> Set.Set Int
toSet h w s = foldr build Set.empty . zip [0..h] $ s
  where
    build (hi, l) st = foldr (b hi) st . zip [0..w] $ l
    b hi (wi, c) st = if c == '#' then Set.insert (hi * w + wi) st else st

solve :: Int -> Int -> Int -> Set.Set Int -> [Set.Set Int]
solve h w k st = filter (\s -> Set.size s == k) $ sts'
  where
    sts = delRows h w k [0 .. h - 1] [st]
    sts' = delCols h w k [0 .. w - 1] sts

delRows :: Int -> Int -> Int -> [Int] -> [Set.Set Int] -> [Set.Set Int]
delRows _ _ _ [] sts = sts
delRows h w k (hq:hs) sts = delRows h w k hs $ concatMap (delRow h w k hq) sts

delCols :: Int -> Int -> Int -> [Int] -> [Set.Set Int] -> [Set.Set Int]
delCols _ _ _ [] sts = sts
delCols h w k (wq:ws) sts = delCols h w k ws $ concatMap (delCol h w k wq) sts


delRow :: Int -> Int -> Int -> Int -> Set.Set Int -> [Set.Set Int]
delRow h w k q st = if Set.size st' < k then [st] else [st, st']
  where
    st' = foldr (\i s -> Set.delete (w * q + i) s) st [0 .. w - 1]

delCol :: Int -> Int -> Int -> Int -> Set.Set Int -> [Set.Set Int]
delCol h w k q st = if Set.size st' < k then [st] else [st, st']
  where
    st' = foldr (\i s -> Set.delete (w * i + q) s) st [0 .. h - 1]
