

from copy import deepcopy



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

C = []

for i in range(H):

    C.append(list(input().strip()))



ans = 0

for h in range(1<<H):

    for w in range(1<<W):

        # print('h={}, w={}'.format(h, w))

        C2 = deepcopy(C)

        for i in range(H):

            if h >> i & 1:

                for j in range(W):

                    C2[i][j] = "."

        for j in range(W):

            if w >> j & 1:

                for i in range(H):

                    C2[i][j] = "."



        cnt = 0

        for i in range(H):

            for j in range(W):

                if C2[i][j] == "#":

                    cnt += 1

        if cnt == K:

            ans += 1



print(ans)

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

C = []

for i in range(H):

    c = list(input().strip())

    C.append(c)



ans = 0

for h in range(1 << H):

    for w in range(1 << W):

        cnt = 0

        for i in range(H):

            for j in range(W):

                if h >> i & 1:

                    continue

                if w >> j & 1:

                    continue

                if C[i][j] == "#":

                    cnt += 1

        if cnt == K:

            ans += 1



print(ans)

from copy import deepcopy

H, W, K = list(map(int, input().split()))
C = []
for i in range(H):
    C.append(list(input().strip()))
ans = 0
for h in range(1 << H):
    for w in range(1 << W):
        # print('h={}, w={}'.format(h, w))
        C2 = deepcopy(C)
        for i in range(H):
            if h >> i & 1:
                for j in range(W):
                    C2[i][j] = "."
        for j in range(W):
            if w >> j & 1:
                for i in range(H):
                    C2[i][j] = "."
        cnt = 0
        for i in range(H):
            for j in range(W):
                if C2[i][j] == "#":
                    cnt += 1
        if cnt == K:
            ans += 1
print(ans)

H, W, K = list(map(int, input().split()))
C = []
for i in range(H):
    c = list(input().strip())
    C.append(c)
ans = 0
for h in range(1 << H):
    for w in range(1 << W):
        cnt = 0
        for i in range(H):
            for j in range(W):
                if h >> i & 1:
                    continue
                if w >> j & 1:
                    continue
                if C[i][j] == "#":
                    cnt += 1
        if cnt == K:
            ans += 1
print(ans)

-from copy import deepcopy - -    C.append(list(input().strip())) +    c = list(input().strip()) +    C.append(c) -        # print('h={}, w={}'.format(h, w)) -        C2 = deepcopy(C) -        for i in range(H): -            if h >> i & 1: -                for j in range(W): -                    C2[i][j] = "." -        for j in range(W): -            if w >> j & 1: -                for i in range(H): -                    C2[i][j] = "." -                if C2[i][j] == "#": +                if h >> i & 1: +                    continue +                if w >> j & 1: +                    continue +                if C[i][j] == "#":