import itertools

import copy

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

c = []

for i in range(h):

    c.append(list(eval(input())))



lish = [-1]

lisw = [-1]

num = [i for i in range(1,h+1)]

numw = [i for i in range(1,w+1)]

numm = [[i] for i in range(1,h+1)]

numww = [[i] for i in range(1,w+1)]

lish.extend(numm)

lisw.extend(numww)

for i in range(2,h+1):

    lish.extend(list(itertools.combinations(num,i)))

for i in range(2,w+1):

    lisw.extend(list(itertools.combinations(numw,i)))



ans = 0

for i in lish:

    for j in lisw:

        tmp = copy.deepcopy(c)

        tmpan = 0

        if i!=-1:

            for ii in i:

                for jj in range(w):

                    tmp[ii-1][jj] = -1

        if j!=-1:

            for jj in j:

                for ii in range(h):

                    tmp[ii][jj-1] = -1

        for ii in range(h):

            for jj in range(w):

                if tmp[ii][jj] == "#":

                    tmpan +=1

        if tmpan ==k:

            ans+=1



print(ans)

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

c = []

for i in range(h):

    c.append(list(eval(input())))

ans = 0

for i in range(2**h-1):

    for j in range(2**w-1):

        num = 0

        for ii in range(h):

            for jj in range(w):

                if  i&1<<ii==0 and j&1<<jj==0:

                    if c[ii][jj]=="#":

                        num += 1

        if num==k:

            #print(i,j)

            ans += 1





print(ans)

import itertools
import copy

h, w, k = list(map(int, input().split()))
c = []
for i in range(h):
    c.append(list(eval(input())))
lish = [-1]
lisw = [-1]
num = [i for i in range(1, h + 1)]
numw = [i for i in range(1, w + 1)]
numm = [[i] for i in range(1, h + 1)]
numww = [[i] for i in range(1, w + 1)]
lish.extend(numm)
lisw.extend(numww)
for i in range(2, h + 1):
    lish.extend(list(itertools.combinations(num, i)))
for i in range(2, w + 1):
    lisw.extend(list(itertools.combinations(numw, i)))
ans = 0
for i in lish:
    for j in lisw:
        tmp = copy.deepcopy(c)
        tmpan = 0
        if i != -1:
            for ii in i:
                for jj in range(w):
                    tmp[ii - 1][jj] = -1
        if j != -1:
            for jj in j:
                for ii in range(h):
                    tmp[ii][jj - 1] = -1
        for ii in range(h):
            for jj in range(w):
                if tmp[ii][jj] == "#":
                    tmpan += 1
        if tmpan == k:
            ans += 1
print(ans)

h, w, k = list(map(int, input().split()))
c = []
for i in range(h):
    c.append(list(eval(input())))
ans = 0
for i in range(2**h - 1):
    for j in range(2**w - 1):
        num = 0
        for ii in range(h):
            for jj in range(w):
                if i & 1 << ii == 0 and j & 1 << jj == 0:
                    if c[ii][jj] == "#":
                        num += 1
        if num == k:
            # print(i,j)
            ans += 1
print(ans)

-import itertools -import copy - -lish = [-1] -lisw = [-1] -num = [i for i in range(1, h + 1)] -numw = [i for i in range(1, w + 1)] -numm = [[i] for i in range(1, h + 1)] -numww = [[i] for i in range(1, w + 1)] -lish.extend(numm) -lisw.extend(numww) -for i in range(2, h + 1): -    lish.extend(list(itertools.combinations(num, i))) -for i in range(2, w + 1): -    lisw.extend(list(itertools.combinations(numw, i))) -for i in lish: -    for j in lisw: -        tmp = copy.deepcopy(c) -        tmpan = 0 -        if i != -1: -            for ii in i: -                for jj in range(w): -                    tmp[ii - 1][jj] = -1 -        if j != -1: -            for jj in j: -                for ii in range(h): -                    tmp[ii][jj - 1] = -1 +for i in range(2**h - 1): +    for j in range(2**w - 1): +        num = 0 -                if tmp[ii][jj] == "#": -                    tmpan += 1 -        if tmpan == k: +                if i & 1 << ii == 0 and j & 1 << jj == 0: +                    if c[ii][jj] == "#": +                        num += 1 +        if num == k: +            # print(i,j)