import numpy as np

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

c = np.zeros((h,w), dtype="int")

f = lambda x: 1 if x=="#" else 0

for i in range(h):

    l=list(map(f,list(eval(input()))))

    c[i] = l



sum_=(c.sum())

cc=0

for i in range(2 ** h):

    l=[]

    for j in range(h):

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

            l.append(j)

            

    for ii in range(2 ** w):

        ll=[]

        for jj in range(w):

            if ((ii >> jj) & 1): 

                ll.append(jj)

        if l and ll:

            ans = (c[l].sum()+c[:,ll].sum()-c[l][:,ll].sum())

        elif l and (not ll):

            ans = (c[l].sum())

        elif ll and (not l):

            ans = (c[:,ll].sum())

        else:

            ans = (0)

        #print(l,ll,ans)

        if sum_-k == ans:

            cc+=1

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

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

ans = 0

for i in range(1<<h):

    for j in range(1<<w):

        cnt = 0

        for x in range(h):

            for y in range(w):

                if (i>>x) & 1 and (j>>y) & 1 and c[x][y] == "#":

                    cnt+=1

        if cnt ==k:

            ans += 1

print(ans)
import numpy as np

h, w, k = list(map(int, input().split()))
c = np.zeros((h, w), dtype="int")
f = lambda x: 1 if x == "#" else 0
for i in range(h):
    l = list(map(f, list(eval(input()))))
    c[i] = l
sum_ = c.sum()
cc = 0
for i in range(2**h):
    l = []
    for j in range(h):
        if (i >> j) & 1:
            l.append(j)
    for ii in range(2**w):
        ll = []
        for jj in range(w):
            if (ii >> jj) & 1:
                ll.append(jj)
        if l and ll:
            ans = c[l].sum() + c[:, ll].sum() - c[l][:, ll].sum()
        elif l and (not ll):
            ans = c[l].sum()
        elif ll and (not l):
            ans = c[:, ll].sum()
        else:
            ans = 0
        # print(l,ll,ans)
        if sum_ - k == ans:
            cc += 1
print(cc)

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

-import numpy as np - -c = np.zeros((h, w), dtype="int") -f = lambda x: 1 if x == "#" else 0 -for i in range(h): -    l = list(map(f, list(eval(input())))) -    c[i] = l -sum_ = c.sum() -cc = 0 -for i in range(2**h): -    l = [] -    for j in range(h): -        if (i >> j) & 1: -            l.append(j) -    for ii in range(2**w): -        ll = [] -        for jj in range(w): -            if (ii >> jj) & 1: -                ll.append(jj) -        if l and ll: -            ans = c[l].sum() + c[:, ll].sum() - c[l][:, ll].sum() -        elif l and (not ll): -            ans = c[l].sum() -        elif ll and (not l): -            ans = c[:, ll].sum() -        else: -            ans = 0 -        # print(l,ll,ans) -        if sum_ - k == ans: -            cc += 1 -print(cc) +c = [eval(input()) for _ in range(h)] +ans = 0 +for i in range(1 << h): +    for j in range(1 << w): +        cnt = 0 +        for x in range(h): +            for y in range(w): +                if (i >> x) & 1 and (j >> y) & 1 and c[x][y] == "#": +                    cnt += 1 +        if cnt == k: +            ans += 1 +print(ans)