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

L = [list(eval(input())) for i in range(H)]

ans = 0

for h in range(1<<H):

    for w in range(1<<W):

        cnt = 0

        for j in range(H):

            for i in range(W):

                if h>>j&1 == 0 and w>>i&1 == 0:

                    if L[j][i] == "#":

                        cnt +=1

        if cnt == K:

            ans +=1

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

L = [list(eval(input())) for i in range(H)]

from itertools import product

li = [0,1]

ans = 0

for h in product(li,repeat = H):

    for w in product(li,repeat = W):

        cnt = 0

        for j in range(H):

            for i in range(W):

                if h[j] == 0 and w[i] == 0:

                    if L[j][i] == "#":

                        cnt +=1

        if cnt == K:

            ans +=1

print(ans)
H, W, K = list(map(int, input().split()))
L = [list(eval(input())) for i in range(H)]
ans = 0
for h in range(1 << H):
    for w in range(1 << W):
        cnt = 0
        for j in range(H):
            for i in range(W):
                if h >> j & 1 == 0 and w >> i & 1 == 0:
                    if L[j][i] == "#":
                        cnt += 1
        if cnt == K:
            ans += 1
print(ans)

H, W, K = list(map(int, input().split()))
L = [list(eval(input())) for i in range(H)]
from itertools import product

li = [0, 1]
ans = 0
for h in product(li, repeat=H):
    for w in product(li, repeat=W):
        cnt = 0
        for j in range(H):
            for i in range(W):
                if h[j] == 0 and w[i] == 0:
                    if L[j][i] == "#":
                        cnt += 1
        if cnt == K:
            ans += 1
print(ans)

+from itertools import product + +li = [0, 1] -for h in range(1 << H): -    for w in range(1 << W): +for h in product(li, repeat=H): +    for w in product(li, repeat=W): -                if h >> j & 1 == 0 and w >> i & 1 == 0: +                if h[j] == 0 and w[i] == 0: