import copy

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

hw = []

mas = []

mas_su = 0



for i in range(h):

    hwi = eval(input())

    masi = []

    for j in range(w):

        if hwi[j] == "#":

            masi.append(1)

        else:

            masi.append(0)



    mas_su += sum(masi)

    mas.append(masi)



l = 2**(h+w)

ans = 0



for i in range(l):

    test = copy.deepcopy(mas)

    num = 0

    for j in range(h+w):

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

            if j < h:

                for p in range(w):

                    if test[j][p]==1:

                        test[j][p] = 0

                        num += 1

            else:

                for p in range(h):

                    if test[p][j-h]==1:

                        test[p][j-h] = 0

                        num += 1

    if mas_su-num == k:

        ans += 1



print(ans)
h, w, k = [int(i) for i in input().split()]

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



ans = 0



for h_1 in range(2**h):

    for w_1 in range(2**w):

        black = 0



        for i in range(h):

            for j in range(w):

                if (h_1 >> i) & 1 == 0 and (w_1 >> j) & 1 == 0 and mas[i][j] == '#':

                    black += 1

        if black == k:

            ans += 1

print(ans)
import copy

h, w, k = list(map(int, input().split()))
hw = []
mas = []
mas_su = 0
for i in range(h):
    hwi = eval(input())
    masi = []
    for j in range(w):
        if hwi[j] == "#":
            masi.append(1)
        else:
            masi.append(0)
    mas_su += sum(masi)
    mas.append(masi)
l = 2 ** (h + w)
ans = 0
for i in range(l):
    test = copy.deepcopy(mas)
    num = 0
    for j in range(h + w):
        if (i >> j) & 1:
            if j < h:
                for p in range(w):
                    if test[j][p] == 1:
                        test[j][p] = 0
                        num += 1
            else:
                for p in range(h):
                    if test[p][j - h] == 1:
                        test[p][j - h] = 0
                        num += 1
    if mas_su - num == k:
        ans += 1
print(ans)

h, w, k = [int(i) for i in input().split()]
mas = [eval(input()) for _ in range(h)]
ans = 0
for h_1 in range(2**h):
    for w_1 in range(2**w):
        black = 0
        for i in range(h):
            for j in range(w):
                if (h_1 >> i) & 1 == 0 and (w_1 >> j) & 1 == 0 and mas[i][j] == "#":
                    black += 1
        if black == k:
            ans += 1
print(ans)

-import copy - -h, w, k = list(map(int, input().split())) -hw = [] -mas = [] -mas_su = 0 -for i in range(h): -    hwi = eval(input()) -    masi = [] -    for j in range(w): -        if hwi[j] == "#": -            masi.append(1) -        else: -            masi.append(0) -    mas_su += sum(masi) -    mas.append(masi) -l = 2 ** (h + w) +h, w, k = [int(i) for i in input().split()] +mas = [eval(input()) for _ in range(h)] -for i in range(l): -    test = copy.deepcopy(mas) -    num = 0 -    for j in range(h + w): -        if (i >> j) & 1: -            if j < h: -                for p in range(w): -                    if test[j][p] == 1: -                        test[j][p] = 0 -                        num += 1 -            else: -                for p in range(h): -                    if test[p][j - h] == 1: -                        test[p][j - h] = 0 -                        num += 1 -    if mas_su - num == k: -        ans += 1 +for h_1 in range(2**h): +    for w_1 in range(2**w): +        black = 0 +        for i in range(h): +            for j in range(w): +                if (h_1 >> i) & 1 == 0 and (w_1 >> j) & 1 == 0 and mas[i][j] == "#": +                    black += 1 +        if black == k: +            ans += 1