local a = io.read()
local b = io.read()
local c = io.read()

local num = 0
for i=1,tonumber(a)*tonumber(b) do
	s = io.read()
	if s == "#" then
		num = num + 1
	end
end
if num <= tonumber(c) then
	print(0)
end
local n = 0
for i= c,num-1 do
	n = n+ i
end
print(n)