n, m, d = gets.chomp.split.map(&:to_i)
arr = []
n.times{arr << gets.chomp.split("")}

sum = 0
for y in 0..(arr.length - 1)
    for x in 0..(arr[0].length - d)
        sum += 1 if arr[y][x, d].join == "." * d
    end
end

arr = arr.transpose
arr.map!{|ar| ar.reverse}
for y in 0..(arr.length - 1)
    for x in 0..(arr[0].length - d)
        sum += 1 if arr[y][x, d].join == "." * d
    end
end
puts sum
