from copy import deepcopy

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

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

ans = 0

for i in range(1 << h):

    for j in range(1 << w):

        t = deepcopy(c)

        for x in range(h):

            for y in range(w):

                if (i >> x & 1) or (j >> y & 1):

                    t[x][y] = "."

        p = 0

        for x in range(h):

            for y in range(w):

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

                    p += 1

        if p == k:

            ans += 1

print(ans)

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

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

ans = 0

for i in range(1 << h):

    for j in range(1 << w):

        cnt = 0

        for x in range(h):

            for y in range(w):

                if (i >> x & 1) or (j >> y & 1):

                    continue

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

                    cnt += 1

        if cnt == k:

            ans += 1

print(ans)
from copy import deepcopy

h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for i in range(h)]
ans = 0
for i in range(1 << h):
    for j in range(1 << w):
        t = deepcopy(c)
        for x in range(h):
            for y in range(w):
                if (i >> x & 1) or (j >> y & 1):
                    t[x][y] = "."
        p = 0
        for x in range(h):
            for y in range(w):
                if t[x][y] == "#":
                    p += 1
        if p == k:
            ans += 1
print(ans)

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

-from copy import deepcopy - -c = [list(eval(input())) for i in range(h)] +c = [eval(input()) for i in range(h)] -        t = deepcopy(c) +        cnt = 0 -                    t[x][y] = "." -        p = 0 -        for x in range(h): -            for y in range(w): -                if t[x][y] == "#": -                    p += 1 -        if p == k: +                    continue +                if c[x][y] == "#": +                    cnt += 1 +        if cnt == k: