program main
    use iso_fortran_env
    implicit none
    integer(int32) :: i, j, n
    integer(int32) :: k, h, w, ans
    integer(int32), allocatable :: nh(:), nw(:)
    character(1), allocatable :: c(:,:)

    read *, h, w, k
    allocate( c(h, w) )
    allocate( nh(h) )
    allocate( nw(w) )
    ans = 0

    do i = 1, h
        read "(*(a1))", c( i, 1:w )
    enddo

    do j = 0, 2**w - 1
        nw = pack( [(n, n = 1, w)], [(btest(j, n), n = 0, w-1)] )

        do i = 0, 2**h - 1
            nh = pack( [(n, n = 1, h)], [(btest(i, n), n = 0, h-1)] )

            if (( count( c(nh, nw) == "#" ) ) == k) then
                ans = ans + 1
            endif
        
        enddo
    enddo

    print *, ans

end program main