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

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

numC, numR = [], []

for i in range(h):

    c[i] = list(eval(input()))



from itertools import permutations, product

from copy import deepcopy



res = 0



for u in product([0, 1], repeat=h): # よこ

    for v in product([0, 1], repeat=w): # たて

        tmp = deepcopy(c)

        for i in range(h):

            if u[i] == 0:

                for j in range(w):

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

                        tmp[i] = '.' * w

        for i in range(w):

            if v[i] == 0:

                for j in range(h):

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

                        tmp[j][i] = '.'

        # count

        cnt = 0

        for j in range(h):

            for i in range(w):

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

                    cnt += 1

        if cnt == k:

            res += 1



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

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

for i in range(h):

    c[i] = eval(input())



res = 0

from itertools import product

for v1 in product([0,1], repeat=h):

    for v2 in product([0,1], repeat=w):

        cnt = 0

        for i in range(h):

            if v1[i] == 0: continue

            for j in range(w):

                if v2[j] == 1 and c[i][j] == '#':

                    cnt += 1

        if cnt == k:

            res += 1

print(res)
h, w, k = list(map(int, input().split()))
c = [[] for _ in range(h)]
numC, numR = [], []
for i in range(h):
    c[i] = list(eval(input()))
from itertools import permutations, product
from copy import deepcopy

res = 0
for u in product([0, 1], repeat=h):  # よこ
    for v in product([0, 1], repeat=w):  # たて
        tmp = deepcopy(c)
        for i in range(h):
            if u[i] == 0:
                for j in range(w):
                    if tmp[i][j] == "#":
                        tmp[i] = "." * w
        for i in range(w):
            if v[i] == 0:
                for j in range(h):
                    if tmp[j][i] == "#":
                        tmp[j][i] = "."
        # count
        cnt = 0
        for j in range(h):
            for i in range(w):
                if tmp[j][i] == "#":
                    cnt += 1
        if cnt == k:
            res += 1
print(res)

h, w, k = list(map(int, input().split()))
c = [[] for _ in range(h)]
for i in range(h):
    c[i] = eval(input())
res = 0
from itertools import product

for v1 in product([0, 1], repeat=h):
    for v2 in product([0, 1], repeat=w):
        cnt = 0
        for i in range(h):
            if v1[i] == 0:
                continue
            for j in range(w):
                if v2[j] == 1 and c[i][j] == "#":
                    cnt += 1
        if cnt == k:
            res += 1
print(res)

-numC, numR = [], [] -    c[i] = list(eval(input())) -from itertools import permutations, product -from copy import deepcopy +    c[i] = eval(input()) +res = 0 +from itertools import product -res = 0 -for u in product([0, 1], repeat=h):  # よこ -    for v in product([0, 1], repeat=w):  # たて -        tmp = deepcopy(c) +for v1 in product([0, 1], repeat=h): +    for v2 in product([0, 1], repeat=w): +        cnt = 0 -            if u[i] == 0: -                for j in range(w): -                    if tmp[i][j] == "#": -                        tmp[i] = "." * w -        for i in range(w): -            if v[i] == 0: -                for j in range(h): -                    if tmp[j][i] == "#": -                        tmp[j][i] = "." -        # count -        cnt = 0 -        for j in range(h): -            for i in range(w): -                if tmp[j][i] == "#": +            if v1[i] == 0: +                continue +            for j in range(w): +                if v2[j] == 1 and c[i][j] == "#":