import itertools

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

 

C=[]

 

for i in range(H):

  C.append(eval(input()))

 

ans=0

for i in range(H+1):

  for j in range(W+1):

    for n in itertools.combinations(list(range(H)),i):

      for m in itertools.combinations(list(range(W)),j):

        count = 0

        for a in n:

          for b in m:

            if(C[a][b]=="#"):

                count+=1

        if(count == K):

          ans += 1

print(ans)
import itertools

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

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

ans = 0



for i in list(itertools.product([0,1], repeat= h)):

    for j in list(itertools.product([0,1], repeat= w)):

        b = 0

        for k in range(h):

            for m in range(w):

                if i[k] == 0 and j[m] == 0 and l[k][m] == '#':

                    b +=1

        if b == n:

            ans += 1

print(ans)
import itertools

H, W, K = list(map(int, input().split()))
C = []
for i in range(H):
    C.append(eval(input()))
ans = 0
for i in range(H + 1):
    for j in range(W + 1):
        for n in itertools.combinations(list(range(H)), i):
            for m in itertools.combinations(list(range(W)), j):
                count = 0
                for a in n:
                    for b in m:
                        if C[a][b] == "#":
                            count += 1
                if count == K:
                    ans += 1
print(ans)

import itertools

h, w, n = list(map(int, input().split()))
l = [str(eval(input())) for _ in range(h)]
ans = 0
for i in list(itertools.product([0, 1], repeat=h)):
    for j in list(itertools.product([0, 1], repeat=w)):
        b = 0
        for k in range(h):
            for m in range(w):
                if i[k] == 0 and j[m] == 0 and l[k][m] == "#":
                    b += 1
        if b == n:
            ans += 1
print(ans)

-H, W, K = list(map(int, input().split())) -C = [] -for i in range(H): -    C.append(eval(input())) +h, w, n = list(map(int, input().split())) +l = [str(eval(input())) for _ in range(h)] -for i in range(H + 1): -    for j in range(W + 1): -        for n in itertools.combinations(list(range(H)), i): -            for m in itertools.combinations(list(range(W)), j): -                count = 0 -                for a in n: -                    for b in m: -                        if C[a][b] == "#": -                            count += 1 -                if count == K: -                    ans += 1 +for i in list(itertools.product([0, 1], repeat=h)): +    for j in list(itertools.product([0, 1], repeat=w)): +        b = 0 +        for k in range(h): +            for m in range(w): +                if i[k] == 0 and j[m] == 0 and l[k][m] == "#": +                    b += 1 +        if b == n: +            ans += 1