      PROGRAM HandV
      IMPLICIT NONE
      INTEGER,PARAMETER :: p = 8
      integer(p) :: h,w,k
      character(6) :: s
      integer(p) :: i,j,ans=0, ii,jj
      logical,allocatable :: c(:,:),cc(:,:)
      
      read*,h,w,k
      allocate( c(h,w),cc(h,w) )
      do i = 1,h
        read*,s
        do j = 1,w
          if( s(j:j)=='#' )then
            c(i,j) = .true.
          else
            c(i,j) = .false.
          end if
        end do
      end do
      
      do ii = 0,2**h-1
        do jj = 0,2**w-1
          cc = c
          do i = 1,h
            if( btest(ii,i-1) ) cc(i,:) = .false.
          end do
          do j = 1,w
            if( btest(jj,j-1) ) cc(:,j) = .false.
          end do
          
          if( count(cc)==k ) ans = ans + 1
        end do
      end do
      
      print*,ans
      
      
      stop
      !debugg
      
      do i = 1,h
        print*,c(i,:)
      end do
      
      print*,count(c)
      
      END PROGRAM