# 多分全探索だと思われるけども

# 2111 ~

# 2115 解法にはbit全探索を用いる.各列，行について塗るか塗らないかでbit探索をしてあげるとたかだか2**(6*2) で10**4程度の計算量に収まる

# 実装



H,W,K = list(map(int,input().split()))

Mo = [[] for _ in range(H)]

for i in range(H):

    Mo[i] = list(eval(input()))



H_num = 2**H

W_num = 2**W

ans = 0

import copy

for i in range(H_num):

    for j in range(W_num):

        M = copy.deepcopy(Mo)

        # sumの計算をしないといけない

        dumi = i

        dumj = j

        SH = [(dumi & 2**kh)//(2**kh) for kh in range(H)]

        SW = [(dumj & 2**kw)//(2**kw) for kw in range(W)]

        num = 0

        for ih,h in enumerate(SH):

            if h == 1:

                M[ih] = ['.' for _ in range(W)]

        for iw,w in enumerate(SW):

            if w == 1:

                for k in range(H):

                    M[k][iw] = '.'

        count = 0

        for ii in range(H):

            for jj in range(W):

                if M[ii][jj] == '#':

                    count += 1

        if count == K:

            ans += 1



print(ans)





H,W,K=list(map(int,input().split()))

C=[]

for _ in range(H):

    C.append(list(eval(input())))

# シフト演算と&を使うと早い.

ans = 0

for i in range(1<<H): # 要するに2**Hのこと

    for j in range(1<<W): # 要するに2**Wのこと

        count = 0

        for i2 in range(H):

            for j2 in range(W):

                bit_i = i>>i2 & 1

                bit_j = j>>j2 & 1

                if bit_i == 1 or bit_j == 1:

                    continue

                if C[i2][j2] == '#':

                    count += 1

        if count == K:

            ans += 1



print(ans)

# 多分全探索だと思われるけども
# 2111 ~
# 2115 解法にはbit全探索を用いる.各列，行について塗るか塗らないかでbit探索をしてあげるとたかだか2**(6*2) で10**4程度の計算量に収まる
# 実装
H, W, K = list(map(int, input().split()))
Mo = [[] for _ in range(H)]
for i in range(H):
    Mo[i] = list(eval(input()))
H_num = 2**H
W_num = 2**W
ans = 0
import copy

for i in range(H_num):
    for j in range(W_num):
        M = copy.deepcopy(Mo)
        # sumの計算をしないといけない
        dumi = i
        dumj = j
        SH = [(dumi & 2**kh) // (2**kh) for kh in range(H)]
        SW = [(dumj & 2**kw) // (2**kw) for kw in range(W)]
        num = 0
        for ih, h in enumerate(SH):
            if h == 1:
                M[ih] = ["." for _ in range(W)]
        for iw, w in enumerate(SW):
            if w == 1:
                for k in range(H):
                    M[k][iw] = "."
        count = 0
        for ii in range(H):
            for jj in range(W):
                if M[ii][jj] == "#":
                    count += 1
        if count == K:
            ans += 1
print(ans)

H, W, K = list(map(int, input().split()))
C = []
for _ in range(H):
    C.append(list(eval(input())))
# シフト演算と&を使うと早い.
ans = 0
for i in range(1 << H):  # 要するに2**Hのこと
    for j in range(1 << W):  # 要するに2**Wのこと
        count = 0
        for i2 in range(H):
            for j2 in range(W):
                bit_i = i >> i2 & 1
                bit_j = j >> j2 & 1
                if bit_i == 1 or bit_j == 1:
                    continue
                if C[i2][j2] == "#":
                    count += 1
        if count == K:
            ans += 1
print(ans)

-# 多分全探索だと思われるけども -# 2111 ~ -# 2115 解法にはbit全探索を用いる.各列，行について塗るか塗らないかでbit探索をしてあげるとたかだか2**(6*2) で10**4程度の計算量に収まる -# 実装 -Mo = [[] for _ in range(H)] -for i in range(H): -    Mo[i] = list(eval(input())) -H_num = 2**H -W_num = 2**W +C = [] +for _ in range(H): +    C.append(list(eval(input()))) +# シフト演算と&を使うと早い. -import copy - -for i in range(H_num): -    for j in range(W_num): -        M = copy.deepcopy(Mo) -        # sumの計算をしないといけない -        dumi = i -        dumj = j -        SH = [(dumi & 2**kh) // (2**kh) for kh in range(H)] -        SW = [(dumj & 2**kw) // (2**kw) for kw in range(W)] -        num = 0 -        for ih, h in enumerate(SH): -            if h == 1: -                M[ih] = ["." for _ in range(W)] -        for iw, w in enumerate(SW): -            if w == 1: -                for k in range(H): -                    M[k][iw] = "." +for i in range(1 << H):  # 要するに2**Hのこと +    for j in range(1 << W):  # 要するに2**Wのこと -        for ii in range(H): -            for jj in range(W): -                if M[ii][jj] == "#": +        for i2 in range(H): +            for j2 in range(W): +                bit_i = i >> i2 & 1 +                bit_j = j >> j2 & 1 +                if bit_i == 1 or bit_j == 1: +                    continue +                if C[i2][j2] == "#":