import numpy as np



H, W, K = list(map(int, input().split()))

C = np.array([[i for i in eval(input())] for j in range(H)])



ans = 0



for h_bit in range(1, 1 << H):

    for w_bit in range(1, 1 << W):

        h_count = []

        for i in range(H):

            if h_bit & (1 << i):

                h_count.append(i)



        w_count = []

        for j in range(W):

            if w_bit & (1 << j):

                w_count.append(j)

        if np.sum(C[np.ix_(h_count, w_count)] == "#") == K:

            ans += 1



print(ans)
H, W, K = list(map(int, input().split()))

C = [[i for i in eval(input())] for j in range(H)]



ans = 0

for h_bit in range(1 << H):

	for w_bit in range(1 << W):

		black = 0

		for i in range(H):

			for j in range(W):

				if h_bit & (1 << i) and w_bit & (1 << j):

					if C[i][j] == '#':

						black += 1

		if black == K:

			ans += 1

			

print(ans)
import numpy as np

H, W, K = list(map(int, input().split()))
C = np.array([[i for i in eval(input())] for j in range(H)])
ans = 0
for h_bit in range(1, 1 << H):
    for w_bit in range(1, 1 << W):
        h_count = []
        for i in range(H):
            if h_bit & (1 << i):
                h_count.append(i)
        w_count = []
        for j in range(W):
            if w_bit & (1 << j):
                w_count.append(j)
        if np.sum(C[np.ix_(h_count, w_count)] == "#") == K:
            ans += 1
print(ans)

H, W, K = list(map(int, input().split()))
C = [[i for i in eval(input())] for j in range(H)]
ans = 0
for h_bit in range(1 << H):
    for w_bit in range(1 << W):
        black = 0
        for i in range(H):
            for j in range(W):
                if h_bit & (1 << i) and w_bit & (1 << j):
                    if C[i][j] == "#":
                        black += 1
        if black == K:
            ans += 1
print(ans)

-import numpy as np - -C = np.array([[i for i in eval(input())] for j in range(H)]) +C = [[i for i in eval(input())] for j in range(H)] -for h_bit in range(1, 1 << H): -    for w_bit in range(1, 1 << W): -        h_count = [] +for h_bit in range(1 << H): +    for w_bit in range(1 << W): +        black = 0 -            if h_bit & (1 << i): -                h_count.append(i) -        w_count = [] -        for j in range(W): -            if w_bit & (1 << j): -                w_count.append(j) -        if np.sum(C[np.ix_(h_count, w_count)] == "#") == K: +            for j in range(W): +                if h_bit & (1 << i) and w_bit & (1 << j): +                    if C[i][j] == "#": +                        black += 1 +        if black == K: