program h_and_v
  implicit none
  integer :: h, w, k, i, j, l, u, a(6, 6) = 0, b(6, 6) = 0, m = 0
  character(6) :: s
  read(*,*) h, w, k
  do i = 1, h
    read(*,*) s
    do j = 1, w
      if (s(j:j) == '#') a(i, j) = 1
    end do
  end do
  u = lshift(1, h + w) - 1
  do l = 0, u
    b = a
    do i = 1, h
      if (btest(l, i - 1)) b(i, :) = -1
    end do
    do j = 1, w
      if (btest(l, j + h - 1)) b(:, j) = -1
    end do
    if (sum(b, b > 0) == k) m = m + 1
  end do
  write(*,'(i0)') m
end program h_and_v