from itertools import product

from copy import deepcopy



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

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



ans = 0

for hl in product([0, 1], repeat=h):

    for wl in product([0, 1], repeat=w):

        cnt = 0

        cc = deepcopy(c)

        for ci, hi in zip(c, hl):

            for cij, wj in zip(ci, wl):

                if cij == '#' and hi == 0 and wj == 0:

                    cnt += 1

        if cnt == k:

            ans += 1

print(ans)

from itertools import product



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

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



ans = 0

for hl in product([0, 1], repeat=h):

    for wl in product([0, 1], repeat=w):

        cnt = 0

        for ci, hi in zip(c, hl):

            for cij, wj in zip(ci, wl):

                if hi == 0 and wj == 0:

                    cnt += (cij == '#')

        ans += (cnt == k)

print(ans)

from itertools import product
from copy import deepcopy

h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for _ in range(h)]
ans = 0
for hl in product([0, 1], repeat=h):
    for wl in product([0, 1], repeat=w):
        cnt = 0
        cc = deepcopy(c)
        for ci, hi in zip(c, hl):
            for cij, wj in zip(ci, wl):
                if cij == "#" and hi == 0 and wj == 0:
                    cnt += 1
        if cnt == k:
            ans += 1
print(ans)

from itertools import product

h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for _ in range(h)]
ans = 0
for hl in product([0, 1], repeat=h):
    for wl in product([0, 1], repeat=w):
        cnt = 0
        for ci, hi in zip(c, hl):
            for cij, wj in zip(ci, wl):
                if hi == 0 and wj == 0:
                    cnt += cij == "#"
        ans += cnt == k
print(ans)

-from copy import deepcopy -        cc = deepcopy(c) -                if cij == "#" and hi == 0 and wj == 0: -                    cnt += 1 -        if cnt == k: -            ans += 1 +                if hi == 0 and wj == 0: +                    cnt += cij == "#" +        ans += cnt == k