@H, @W, @K = gets.split.map(&:to_i)
@dots = []
@dots << Array.new(@H, 0)
@answer = 0

def remove(dots, count)
    
    if dots.length == 1 
        @answer += 1 if dots.inject(:+) == count
        return
    end

    dots.each_with_index do | n , i |
        sum = n.inject(:+)
        if count - sum == 0
            @answer += 1
            next
        elsif count - sum < 0
            next
        else
            dots.delete_at(i)
            remove(dots, count - sum )
            remove(dots.transpose, count - sum)
        end
    end
end

@H.times do | n |
   line = gets.chomp.split("").map{ |x| x == "#" ? 1 : 0 }
   @dots << line
   @dots << Array.new(@W,0)
end

remove(@dots, @K)
puts @answer