import copy

import numpy as np





def count_black(c):

    count = 0

    for row in c:

        count += row.count('#')

    return count





h, w, k = list(map(int, input().split()))

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

ans = 0



for h_p in range(2 ** h):

    for w_p in range(2 ** w):

        c_cp = np.array(copy.deepcopy(c))

        for i in range(h):

            if (h_p >> i) & 1:

                c_cp[i, :] = 'r'



        for j in range(w):

            if (w_p >> j) & 1:

                c_cp[:, j] = 'r'



        if count_black(c_cp.tolist()) == k:

            ans += 1

print(ans)

h, w, k = list(map(int, input().split()))

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

ans = 0

for h_p in range(2 ** h):

    for w_p in range(2 ** w):

        cnt = 0

        for i in range(h):

            for j in range(w):

                if (h_p >> i) & 1 and (w_p >> j) & 1 and c[i][j] == '#':

                    cnt += 1

        if cnt == k:

            ans += 1

print(ans)
import copy
import numpy as np


def count_black(c):
    count = 0
    for row in c:
        count += row.count("#")
    return count


h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for _ in range(h)]
ans = 0
for h_p in range(2**h):
    for w_p in range(2**w):
        c_cp = np.array(copy.deepcopy(c))
        for i in range(h):
            if (h_p >> i) & 1:
                c_cp[i, :] = "r"
        for j in range(w):
            if (w_p >> j) & 1:
                c_cp[:, j] = "r"
        if count_black(c_cp.tolist()) == k:
            ans += 1
print(ans)

h, w, k = list(map(int, input().split()))
c = [eval(input()) for _ in range(h)]
ans = 0
for h_p in range(2**h):
    for w_p in range(2**w):
        cnt = 0
        for i in range(h):
            for j in range(w):
                if (h_p >> i) & 1 and (w_p >> j) & 1 and c[i][j] == "#":
                    cnt += 1
        if cnt == k:
            ans += 1
print(ans)

-import copy -import numpy as np - - -def count_black(c): -    count = 0 -    for row in c: -        count += row.count("#") -    return count - - -c = [list(eval(input())) for _ in range(h)] +c = [eval(input()) for _ in range(h)] -        c_cp = np.array(copy.deepcopy(c)) +        cnt = 0 -            if (h_p >> i) & 1: -                c_cp[i, :] = "r" -        for j in range(w): -            if (w_p >> j) & 1: -                c_cp[:, j] = "r" -        if count_black(c_cp.tolist()) == k: +            for j in range(w): +                if (h_p >> i) & 1 and (w_p >> j) & 1 and c[i][j] == "#": +                    cnt += 1 +        if cnt == k: