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

c=[]

ans = 0

for i in range(h):

    c.append(eval(input()))



for maskR in range(1<<h):

    for maskC in range(1<<w):

        black = 0

        for i in range(h):

            for j in range(w):

                if maskR >> i & 1 == 1 and maskC >> j & 1== 1 and c[i][j]=='#':

                    black += 1





        if black ==k:

            ans += 1



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

c = []

ans = 0

for i in range(h):

    c.append(eval(input()))



for maskR in range(1 << h):

    for maskC in range(1 << w):

        black = 0

        for i in range(h):

            for j in range(w):

                if maskR >> i & 1 == 0 and maskC >> j & 1 == 0 and c[i][j] == '#':

                    black += 1

        if black == k:

            ans += 1



print(ans)

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

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

-                if maskR >> i & 1 == 1 and maskC >> j & 1 == 1 and c[i][j] == "#": +                if maskR >> i & 1 == 0 and maskC >> j & 1 == 0 and c[i][j] == "#":