from copy import deepcopy

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

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



A = 0

for bit in range(2 ** H):

    D = deepcopy(c)

    for i in range(H):

        if (bit & (1 << i)):

            for k in range(W):

                D[i][k] = '.'

    for bit2 in range(2 ** W):

        E = deepcopy(D)

        for j in range(W):

            if (bit2 & (1 << j)):

                for k in range(H):

                    E[k][j] = '.'

        X = 0

        for k in range(H):

            X += E[k].count('#')

        if X == K:

            A += 1



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

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



A = 0

for ibit in range(2 ** H):

    for jbit in range(2 ** W):

        B = 0

        for i in range(H):

            for j in range(W):

                if (ibit & (1 << i)) or (jbit & (1 << j)):

                    continue

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

                    B += 1

        if B == K:

            A += 1

print(A)
from copy import deepcopy

H, W, K = list(map(int, input().split()))
c = [list(eval(input())) for _ in range(H)]
A = 0
for bit in range(2**H):
    D = deepcopy(c)
    for i in range(H):
        if bit & (1 << i):
            for k in range(W):
                D[i][k] = "."
    for bit2 in range(2**W):
        E = deepcopy(D)
        for j in range(W):
            if bit2 & (1 << j):
                for k in range(H):
                    E[k][j] = "."
        X = 0
        for k in range(H):
            X += E[k].count("#")
        if X == K:
            A += 1
print(A)

H, W, K = list(map(int, input().split()))
c = [list(eval(input())) for _ in range(H)]
A = 0
for ibit in range(2**H):
    for jbit in range(2**W):
        B = 0
        for i in range(H):
            for j in range(W):
                if (ibit & (1 << i)) or (jbit & (1 << j)):
                    continue
                if c[i][j] == "#":
                    B += 1
        if B == K:
            A += 1
print(A)

-from copy import deepcopy - -for bit in range(2**H): -    D = deepcopy(c) -    for i in range(H): -        if bit & (1 << i): -            for k in range(W): -                D[i][k] = "." -    for bit2 in range(2**W): -        E = deepcopy(D) -        for j in range(W): -            if bit2 & (1 << j): -                for k in range(H): -                    E[k][j] = "." -        X = 0 -        for k in range(H): -            X += E[k].count("#") -        if X == K: +for ibit in range(2**H): +    for jbit in range(2**W): +        B = 0 +        for i in range(H): +            for j in range(W): +                if (ibit & (1 << i)) or (jbit & (1 << j)): +                    continue +                if c[i][j] == "#": +                    B += 1 +        if B == K: