import           Control.Applicative
import           Data.Array
import           Data.List

rows :: Array (Int, Int) a -> [[a]]
rows arr = let ((a, b), (c, d)) = bounds arr in [[arr ! (i, j) | j <- [b..d]] | i <- [a..c]]

columns :: Array (Int, Int) a -> [[a]]
columns arr = let ((a, b), (c, d)) = bounds arr in [[arr ! (i, j) | i <- [a..c]] | j <- [b..d]]

possibleSpaces :: Int -> [Bool] -> Int
possibleSpaces d = sum . fmap ((\n -> (n - d + 1) `max` 0) . length). filter head . group

main = do
  [n, m, d] <- fmap read . words <$> getLine
  a <- listArray ((1,1), (n, m)). concatMap (fmap (=='.')) . lines <$> getContents
  print $ sum $ fmap (possibleSpaces d) (rows a ++ columns a)

