Module Module1

    Sub Main()
        Dim H, W, K As Integer
        Dim tbl(35, 35) As String
        Dim arr() As Integer = Array.ConvertAll(Of String, Integer)(Console.ReadLine.Split(" "), AddressOf Integer.Parse)
        H = arr(0) : W = arr(1) : K = arr(2)
        Dim result As Integer = 0
        For i As Integer = 0 To H - 1
            Dim s As String = Console.ReadLine
            For j As Integer = 0 To W - 1
                tbl(j, i) = s.Substring(j, 1)
            Next
        Next

        For bit = 0 To (1 << W) - 1
            Dim width(W - 1) As Integer
            For i As Integer = 0 To W - 1
                If (bit >> i) And 1 Then
                    width(i) = 1
                End If
            Next
            For bit2 = 0 To (1 << H) - 1
                Dim hight(H - 1) As Integer
                For j As Integer = 0 To H - 1
                    If (bit2 >> j) And 1 Then
                        hight(j) = 1
                    End If
                Next
                Dim count As Integer = 0
                Dim g(,) As String = CType(tbl.Clone(), String(,))
                For y As Integer = 0 To H - 1
                    For x As Integer = 0 To W - 1
                        If hight(y) = 1 Then
                            g(x, y) = "R"
                        ElseIf width(x) = 1 Then
                            g(x, y) = "R"
                        ElseIf tbl(x, y) = "#" Then
                            count = count + 1
                        End If
                    Next
                Next

                If count = K Then
                    result = result + 1
                End If
            Next
        Next
        Console.WriteLine(result)
        'Debug.WriteLine(result)
    End Sub

End Module
