program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: h,w,k
    integer(int32):: x,y,i,j,black,ans=0
    character(1),allocatable:: c(:,:)

    read*, h,w,k
    allocate(c(w,h))
    do y=1,h
        block; character(w):: inpt_c
            read*, inpt_c
            do x=1,w
                c(x,y) = inpt_c(x:x)
            end do
        end block
    end do

    do i=0,2**h-1
        do j=0,2**w-1
            black = count_black(i,j)
            if (count_black(i,j) == k) ans=ans+1
        end do
    end do
    print'(i0)', ans
contains
    function count_black(i,j) result(ret)
        integer(int32):: i,j,ret
        integer(int32):: x,y

        ret=0
        do y=1,h
            if (btest(i,y-1)) cycle
            do x=1,w
                if (btest(j,x-1))cycle
                if (c(x,y) == '#') ret=ret+1
            end do
        end do
    end function
end program main