import copy

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

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

count = 0

for i in range(2**h):

    for j in range(2**w):

        d = copy.deepcopy(c)

        for t in range(h):

            if (i >> t) & 1: 

                for q in range(w):

                    d[t][q] = "x"

        for t in range(w):

            if (j >> t) & 1: 

                for q in range(h):

                    d[q][t] = "x"

        ci = 0

        for m in d:

            ci += m.count("#")

        if ci == k:

            count += 1



print(count)

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

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



ans = 0

for i in range(1<<H):

    for j in range(1<<W):

        count = 0

        for h in range(H):

            for w in range(W):

                if ((i>>h)& 1) or ((j>>w)& 1) or C[h][w] == ".":

                    continue

                count += 1

        if count == K:

            ans += 1

print(ans)
import copy

h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for i in range(h)]
count = 0
for i in range(2**h):
    for j in range(2**w):
        d = copy.deepcopy(c)
        for t in range(h):
            if (i >> t) & 1:
                for q in range(w):
                    d[t][q] = "x"
        for t in range(w):
            if (j >> t) & 1:
                for q in range(h):
                    d[q][t] = "x"
        ci = 0
        for m in d:
            ci += m.count("#")
        if ci == k:
            count += 1
print(count)

H, W, K = list(map(int, input().split()))
C = [list(eval(input())) for i in range(H)]
ans = 0
for i in range(1 << H):
    for j in range(1 << W):
        count = 0
        for h in range(H):
            for w in range(W):
                if ((i >> h) & 1) or ((j >> w) & 1) or C[h][w] == ".":
                    continue
                count += 1
        if count == K:
            ans += 1
print(ans)

-import copy - -h, w, k = list(map(int, input().split())) -c = [list(eval(input())) for i in range(h)] -count = 0 -for i in range(2**h): -    for j in range(2**w): -        d = copy.deepcopy(c) -        for t in range(h): -            if (i >> t) & 1: -                for q in range(w): -                    d[t][q] = "x" -        for t in range(w): -            if (j >> t) & 1: -                for q in range(h): -                    d[q][t] = "x" -        ci = 0 -        for m in d: -            ci += m.count("#") -        if ci == k: -            count += 1 -print(count) +H, W, K = list(map(int, input().split())) +C = [list(eval(input())) for i in range(H)] +ans = 0 +for i in range(1 << H): +    for j in range(1 << W): +        count = 0 +        for h in range(H): +            for w in range(W): +                if ((i >> h) & 1) or ((j >> w) & 1) or C[h][w] == ".": +                    continue +                count += 1 +        if count == K: +            ans += 1 +print(ans)