function rl()
   local r = {}
   for word in io.read():gmatch("%S+") do
      table.insert(r, tonumber(word))
   end
   return r
end

function ru()
   return unpack(rl())
end

function pu(x, ...)
   if x then
      io.write(x, ' ')
      return pu(...)
   else
      io.write('\n')
   end
end

H, W, K = ru()
c = {}
for i = 1, H do
   c[i] = {}
   for j = 1, W do
      c[i][j] = io.read(1)
   end
   io.read()
end

function line(i)
   if i > H then
      return col(1)
   else
      local save = {}
      for j = 1, W do
	 save[j] = c[i][j]
	 c[i][j] = 'x'
      end
      local r = line(i + 1)
      for j = 1, W do
	 c[i][j] = save[j]
      end
      return r + line(i + 1)
   end
end

function col(j)
   if j > W then
      local count = 0
      for i = 1, H do
	 for j = 1, W do
	    if c[i][j] == '#' then
	       count = count + 1
	    end
	 end
      end
      return count == K and 1 or 0
   else
      local save = {}
      for i = 1, H do
	 save[i] = c[i][j]
	 c[i][j] = 'x'
      end
      local r = col(j + 1)
      for i = 1, H do
	 c[i][j] = save[i]
      end
      return r + col(j + 1)
   end
end

pu(line(1))
