h, w, k = gets.chomp.split.map(&:to_i)

mat = []

h.times do
  mat << gets.chomp.gsub(".", "0").gsub("#", "1")
end

count = 0
0.upto((1 << h) - 1) do |i|
  0.upto((1 << w) - 1) do |j|
    selected_row = mat.select.with_index { |row, idx| (1 << idx) & i > 0 }
    sharp_num = 0
    selected_row.each do |row|
      sharp_num += (row.to_i(2) & j).to_s(2).count("1")
    end

    count += 1 if k == sharp_num
  end
end

puts count
