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

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



ptns = []

for i in range(2**(h+w)):

    tmp = []

    for j in range(h+w):

        if i>>j & 1:

            tmp.append(1)

        else:

            tmp.append(0)

    ptns.append(tmp)



import copy

from itertools import chain



ans = 0

for ptn in ptns:

    tmp = copy.deepcopy(pic)

    for x in range(h):

        for y in range(w):

            if ptn[y] == 1:

                tmp[x][y] = 0

        if ptn[w+x] == 1:

            tmp[x] = [0]

    tmp = list(chain.from_iterable(tmp))



    if tmp.count('#') == k:

        ans += 1

print(ans)

# ビット演算でなく, itertoolsモジュールのproductとrange(2)の組み合わせを活用.

# ※を！



from itertools import product



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

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

#print(c)



ans = 0



#l = list(product(range(2), repeat=h))

#m = list(product(range(2), repeat=w))

#print(l)

#print(m)



for row_bit in product(list(range(2)), repeat=h):# ※長さがhで, 要素が'1'か'0'であるすべての組み合わせをすべて列挙

    for col_bit in product(list(range(2)), repeat=w):

        cnt = 0

        for row in range(h):

            for col in range(w):

                #print(row_bit[row] and col_bit[col])

                if c[row][col] == "#" and (row_bit[row] and col_bit[col]):# ここのブール演算！

                    cnt += 1

        if cnt == k:

            ans += 1



print(ans)
h, w, k = list(map(int, input().split()))
pic = [list(eval(input())) for _ in range(h)]
ptns = []
for i in range(2 ** (h + w)):
    tmp = []
    for j in range(h + w):
        if i >> j & 1:
            tmp.append(1)
        else:
            tmp.append(0)
    ptns.append(tmp)
import copy
from itertools import chain

ans = 0
for ptn in ptns:
    tmp = copy.deepcopy(pic)
    for x in range(h):
        for y in range(w):
            if ptn[y] == 1:
                tmp[x][y] = 0
        if ptn[w + x] == 1:
            tmp[x] = [0]
    tmp = list(chain.from_iterable(tmp))
    if tmp.count("#") == k:
        ans += 1
print(ans)

# ビット演算でなく, itertoolsモジュールのproductとrange(2)の組み合わせを活用.
# ※を！
from itertools import product

h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for _ in range(h)]
# print(c)
ans = 0
# l = list(product(range(2), repeat=h))
# m = list(product(range(2), repeat=w))
# print(l)
# print(m)
for row_bit in product(
    list(range(2)), repeat=h
):  # ※長さがhで, 要素が'1'か'0'であるすべての組み合わせをすべて列挙
    for col_bit in product(list(range(2)), repeat=w):
        cnt = 0
        for row in range(h):
            for col in range(w):
                # print(row_bit[row] and col_bit[col])
                if c[row][col] == "#" and (row_bit[row] and col_bit[col]):  # ここのブール演算！
                    cnt += 1
        if cnt == k:
            ans += 1
print(ans)

+# ビット演算でなく, itertoolsモジュールのproductとrange(2)の組み合わせを活用. +# ※を！ +from itertools import product + -pic = [list(eval(input())) for _ in range(h)] -ptns = [] -for i in range(2 ** (h + w)): -    tmp = [] -    for j in range(h + w): -        if i >> j & 1: -            tmp.append(1) -        else: -            tmp.append(0) -    ptns.append(tmp) -import copy -from itertools import chain - +c = [list(eval(input())) for _ in range(h)] +# print(c) -for ptn in ptns: -    tmp = copy.deepcopy(pic) -    for x in range(h): -        for y in range(w): -            if ptn[y] == 1: -                tmp[x][y] = 0 -        if ptn[w + x] == 1: -            tmp[x] = [0] -    tmp = list(chain.from_iterable(tmp)) -    if tmp.count("#") == k: -        ans += 1 +# l = list(product(range(2), repeat=h)) +# m = list(product(range(2), repeat=w)) +# print(l) +# print(m) +for row_bit in product( +    list(range(2)), repeat=h +):  # ※長さがhで, 要素が'1'か'0'であるすべての組み合わせをすべて列挙 +    for col_bit in product(list(range(2)), repeat=w): +        cnt = 0 +        for row in range(h): +            for col in range(w): +                # print(row_bit[row] and col_bit[col]) +                if c[row][col] == "#" and (row_bit[row] and col_bit[col]):  # ここのブール演算！ +                    cnt += 1 +        if cnt == k: +            ans += 1