# -*- coding: utf-8 -*-

import numpy as np

import itertools

from copy import deepcopy



H, W , K = [int(i) for i in input().split()]



Arr = np.zeros((H, W))

for i in range(H):

    words = eval(input())

    for j, w in enumerate(words):

        if w == "#":

            Arr[i,j] = 1

#print(Arr)

ans = 0

for t in range(0,H+W):

    Ex = list(itertools.combinations([int(i) for i in range(H+W)],t))

    for j in Ex:

        TMP = deepcopy(Arr)

        for num in j:

            if num < H:

                TMP[num] = np.zeros(W)

            else:

                w = num - H

                #print(TMP)

                TMP[:,w] = np.zeros(H)

                #print(w,TMP[:,w])

        if K == int(np.sum(TMP)):

            ans += 1

print(ans)

# -*- coding: utf-8 -*-

from itertools import product



H, W , K = [int(i) for i in input().split()]

c = [list(eval(input())) for _ in range(H)]

ans = 0



for row_bit in product(list(range(2)),repeat=H):

    for col_bit in product(list(range(2)),repeat=W):

        cnt = 0

        for row in range(H):

            for col in range(W):

                if c[row][col] == "#" and  (row_bit[row] and col_bit[col]):

                    cnt += 1

        if cnt == K:

            ans += 1

print(ans)

# -*- coding: utf-8 -*-
import numpy as np
import itertools
from copy import deepcopy

H, W, K = [int(i) for i in input().split()]
Arr = np.zeros((H, W))
for i in range(H):
    words = eval(input())
    for j, w in enumerate(words):
        if w == "#":
            Arr[i, j] = 1
# print(Arr)
ans = 0
for t in range(0, H + W):
    Ex = list(itertools.combinations([int(i) for i in range(H + W)], t))
    for j in Ex:
        TMP = deepcopy(Arr)
        for num in j:
            if num < H:
                TMP[num] = np.zeros(W)
            else:
                w = num - H
                # print(TMP)
                TMP[:, w] = np.zeros(H)
                # print(w,TMP[:,w])
        if K == int(np.sum(TMP)):
            ans += 1
print(ans)

# -*- coding: utf-8 -*-
from itertools import product

H, W, K = [int(i) for i in input().split()]
c = [list(eval(input())) for _ in range(H)]
ans = 0
for row_bit in product(list(range(2)), repeat=H):
    for col_bit in product(list(range(2)), repeat=W):
        cnt = 0
        for row in range(H):
            for col in range(W):
                if c[row][col] == "#" and (row_bit[row] and col_bit[col]):
                    cnt += 1
        if cnt == K:
            ans += 1
print(ans)

-import numpy as np -import itertools -from copy import deepcopy +from itertools import product -Arr = np.zeros((H, W)) -for i in range(H): -    words = eval(input()) -    for j, w in enumerate(words): -        if w == "#": -            Arr[i, j] = 1 -# print(Arr) +c = [list(eval(input())) for _ in range(H)] -for t in range(0, H + W): -    Ex = list(itertools.combinations([int(i) for i in range(H + W)], t)) -    for j in Ex: -        TMP = deepcopy(Arr) -        for num in j: -            if num < H: -                TMP[num] = np.zeros(W) -            else: -                w = num - H -                # print(TMP) -                TMP[:, w] = np.zeros(H) -                # print(w,TMP[:,w]) -        if K == int(np.sum(TMP)): +for row_bit in product(list(range(2)), repeat=H): +    for col_bit in product(list(range(2)), repeat=W): +        cnt = 0 +        for row in range(H): +            for col in range(W): +                if c[row][col] == "#" and (row_bit[row] and col_bit[col]): +                    cnt += 1 +        if cnt == K: