from copy import deepcopy as dc



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

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



ans = 0

for h_i in range(2 ** h):

    temp = dc(c)

    for h_j in range(h):

        if (h_i >> h_j) & 1:

            temp[h_j] = ["+"] * w

    for w_i in range(2 ** w):

        temp2 = dc(temp)

        for w_j in range(w):

            if (w_i >> w_j) & 1:

                for i in range(h):

                    temp2[i][w_j] = "+"

        temp_ans = 0

        for i in range(h):

            temp_ans = temp_ans + "".join(temp2[i]).count("#")

        if temp_ans == k:

            ans = ans + 1

print(ans)
from itertools import product as pd



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

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



ans = 0

for i, j in pd(list(range(1 << h)), list(range(1 << w))):

    temp = 0

    for x, y in pd(list(range(h)), list(range(w))):

        if 1 << x & i and 1 << y & j:

            if c[x][y] == "#":

                temp += 1

    ans += temp == k

print(ans)
from copy import deepcopy as dc

h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for _ in range(h)]
ans = 0
for h_i in range(2**h):
    temp = dc(c)
    for h_j in range(h):
        if (h_i >> h_j) & 1:
            temp[h_j] = ["+"] * w
    for w_i in range(2**w):
        temp2 = dc(temp)
        for w_j in range(w):
            if (w_i >> w_j) & 1:
                for i in range(h):
                    temp2[i][w_j] = "+"
        temp_ans = 0
        for i in range(h):
            temp_ans = temp_ans + "".join(temp2[i]).count("#")
        if temp_ans == k:
            ans = ans + 1
print(ans)

from itertools import product as pd

h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for _ in range(h)]
ans = 0
for i, j in pd(list(range(1 << h)), list(range(1 << w))):
    temp = 0
    for x, y in pd(list(range(h)), list(range(w))):
        if 1 << x & i and 1 << y & j:
            if c[x][y] == "#":
                temp += 1
    ans += temp == k
print(ans)

-from copy import deepcopy as dc +from itertools import product as pd -for h_i in range(2**h): -    temp = dc(c) -    for h_j in range(h): -        if (h_i >> h_j) & 1: -            temp[h_j] = ["+"] * w -    for w_i in range(2**w): -        temp2 = dc(temp) -        for w_j in range(w): -            if (w_i >> w_j) & 1: -                for i in range(h): -                    temp2[i][w_j] = "+" -        temp_ans = 0 -        for i in range(h): -            temp_ans = temp_ans + "".join(temp2[i]).count("#") -        if temp_ans == k: -            ans = ans + 1 +for i, j in pd(list(range(1 << h)), list(range(1 << w))): +    temp = 0 +    for x, y in pd(list(range(h)), list(range(w))): +        if 1 << x & i and 1 << y & j: +            if c[x][y] == "#": +                temp += 1 +    ans += temp == k