import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc: Scanner = new Scanner(System.in)
    val N: Int = sc.nextInt
    val M: Int = sc.nextInt
    val D: Int = sc.nextInt
    val A: Array[String] = Array.fill[String](N)(sc.next)

    var ans = 0
    for {
      i <- 0 until N
      j <- 0 to M - D
    } (
      ans += (if (Array.tabulate[Char](D)(k => A(i)(j + k)).forall('.' ==)) (1) else (0))
      )
    for {
      i <- 0 to N - D
      j <- 0 until M
    } (
      ans += (if (Array.tabulate[Char](D)(k => A(i + k)(j)).forall('.' ==)) (1) else (0))
      )
    println(ans)
  }
}