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

ls = [0] * h

result = 0



for i in range(h):

    ls[i] = eval(input())



for i in range(1<<h):

    for j in range(1<<w):

        cnt = 0

        for s in range(h):

            for t in range(w):

                if ((i>>s) & 1) & ((j>>t) & 1): 

                    if ls[s][t] == '#':

                        cnt += 1

        if cnt == k:

            result += 1

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

ls = []



for i in range(H):

    ls.append(list(eval(input())))



rst = 0

for i in range(1 << H):

    for s in range(1 << W):

        cnt = 0

        for j in range(H):

            if i>>j & 1:

                continue

            for t in range(W):

                if s>>t & 1:

                    continue

                if ls[j][t] == '#':

                    cnt += 1

        if cnt == K:

            rst += 1

print(rst)
h, w, k = list(map(int, input().split(" ")))
ls = [0] * h
result = 0
for i in range(h):
    ls[i] = eval(input())
for i in range(1 << h):
    for j in range(1 << w):
        cnt = 0
        for s in range(h):
            for t in range(w):
                if ((i >> s) & 1) & ((j >> t) & 1):
                    if ls[s][t] == "#":
                        cnt += 1
        if cnt == k:
            result += 1
print(result)

H, W, K = list(map(int, input().split(" ")))
ls = []
for i in range(H):
    ls.append(list(eval(input())))
rst = 0
for i in range(1 << H):
    for s in range(1 << W):
        cnt = 0
        for j in range(H):
            if i >> j & 1:
                continue
            for t in range(W):
                if s >> t & 1:
                    continue
                if ls[j][t] == "#":
                    cnt += 1
        if cnt == K:
            rst += 1
print(rst)

-h, w, k = list(map(int, input().split(" "))) -ls = [0] * h -result = 0 -for i in range(h): -    ls[i] = eval(input()) -for i in range(1 << h): -    for j in range(1 << w): +H, W, K = list(map(int, input().split(" "))) +ls = [] +for i in range(H): +    ls.append(list(eval(input()))) +rst = 0 +for i in range(1 << H): +    for s in range(1 << W): -        for s in range(h): -            for t in range(w): -                if ((i >> s) & 1) & ((j >> t) & 1): -                    if ls[s][t] == "#": -                        cnt += 1 -        if cnt == k: -            result += 1 -print(result) +        for j in range(H): +            if i >> j & 1: +                continue +            for t in range(W): +                if s >> t & 1: +                    continue +                if ls[j][t] == "#": +                    cnt += 1 +        if cnt == K: +            rst += 1 +print(rst)