Imports System

Module Program
    Sub Main(args As String())

        Dim HWK() As Integer = Console.ReadLine().Split(" ").Select(Function(x) Integer.Parse(x)).ToArray()

        Dim c As New List(Of Integer)

        Dim kuroBak As New List(Of Integer)


        For i As Integer = 0 To HWK(0) - 1
            Dim tmp As String = Console.ReadLine()
            For j As Integer = 0 To HWK(1) - 1
                If Mid(tmp, j + 1, 1) = "#" Then
                    kuroBak.Add(i * 6 + j + 1)
                End If
            Next
        Next

        Dim r As Integer = 0

        For i As Integer = 0 To 2 ^ HWK(0) - 1
            Dim kuro As List(Of Integer) = New List(Of Integer)(kuroBak)
            Call Gyo(kuro, i)
            For j As Integer = 0 To 2 ^ HWK(1) - 1
                Dim kuro2 As List(Of Integer) = New List(Of Integer)(kuro)
                Call Retu(kuro2, j)
                If kuro2.Count() = HWK(2) Then
                    r += 1
                End If
            Next
        Next

        Console.WriteLine(r)

    End Sub

    Private Sub Gyo(hp As List(Of Integer), i As Integer)

        For g As Integer = 6 To 0 Step -1
            If i >= 2 ^ g Then
                i -= 2 ^ g
                For os = 0 To 5
                    hp.Remove((g + 1) * 6 - os)
                Next
            End If
        Next

    End Sub
    Private Sub Retu(wp As List(Of Integer), j As Integer)

        For r As Integer = 6 To 0 Step -1
            If j >= 2 ^ r Then
                j -= 2 ^ r
                For os = 0 To 5
                    wp.Remove((r + 1) + os * 6)
                Next
            End If
        Next

    End Sub

End Module
