from itertools import product



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

grid = [eval(input()) for _ in range(H)]



ans = 0

for a in product([0, 1], repeat=H):

    for b in product([0, 1], repeat=W):

        cnt = 0

        for i in range(H):

            if a[i] == 1:

                continue

            for j in range(W):

                if b[j] == 1:

                    continue

                if grid[i][j] == '#':

                    cnt += 1

        if cnt == K:

            ans += 1



print(ans)

from itertools import product



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

grid = [eval(input()) for _ in range(H)]



ans = 0

for row in product([0, 1], repeat=H):

    for col in product([0, 1], repeat=W):

        cnt = 0

        for i in range(H):

            for j in range(W):

                if row[i] == 0 and col[j] == 0 and grid[i][j] == '#':

                    cnt += 1

        if cnt == K:

            ans += 1



print(ans)
from itertools import product

H, W, K = list(map(int, input().split()))
grid = [eval(input()) for _ in range(H)]
ans = 0
for a in product([0, 1], repeat=H):
    for b in product([0, 1], repeat=W):
        cnt = 0
        for i in range(H):
            if a[i] == 1:
                continue
            for j in range(W):
                if b[j] == 1:
                    continue
                if grid[i][j] == "#":
                    cnt += 1
        if cnt == K:
            ans += 1
print(ans)

from itertools import product

H, W, K = list(map(int, input().split()))
grid = [eval(input()) for _ in range(H)]
ans = 0
for row in product([0, 1], repeat=H):
    for col in product([0, 1], repeat=W):
        cnt = 0
        for i in range(H):
            for j in range(W):
                if row[i] == 0 and col[j] == 0 and grid[i][j] == "#":
                    cnt += 1
        if cnt == K:
            ans += 1
print(ans)

-for a in product([0, 1], repeat=H): -    for b in product([0, 1], repeat=W): +for row in product([0, 1], repeat=H): +    for col in product([0, 1], repeat=W): -            if a[i] == 1: -                continue -                if b[j] == 1: -                    continue -                if grid[i][j] == "#": +                if row[i] == 0 and col[j] == 0 and grid[i][j] == "#":