from copy import deepcopy

import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines



def main():

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

    C = [list(readline().strip()) for _ in range(H)]

    

    ans = 0

    for i in range(2**(H+W)):

        c = deepcopy(C)

        for j in range(H+W):

            if (i >> j) & 1:

                if j < H:

                    for s in range(W):

                        c[j][s] = "."

                else:

                    for k in range(H):

                        c[k][j-H] = "."

        cnt = 0

        for line in c:

            cnt += line.count("#")

        if cnt == K:

            ans += 1



    print(ans)





if __name__ == "__main__":

    main()

import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines



def main():

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

    C = [readline().strip() for _ in range(H)]

    

    ans = 0

    for i in range(2**H):

        for j in range(2**W):

            cnt = 0

            for s in range(H):

                for t in range(W):

                    if (i >> s) & 1 and (j >> t) & 1 and C[s][t] == "#":

                        cnt += 1

            if cnt == K:

                ans += 1



    print(ans)





if __name__ == "__main__":

    main()

from copy import deepcopy
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    H, W, K = list(map(int, readline().split()))
    C = [list(readline().strip()) for _ in range(H)]
    ans = 0
    for i in range(2 ** (H + W)):
        c = deepcopy(C)
        for j in range(H + W):
            if (i >> j) & 1:
                if j < H:
                    for s in range(W):
                        c[j][s] = "."
                else:
                    for k in range(H):
                        c[k][j - H] = "."
        cnt = 0
        for line in c:
            cnt += line.count("#")
        if cnt == K:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    H, W, K = list(map(int, readline().split()))
    C = [readline().strip() for _ in range(H)]
    ans = 0
    for i in range(2**H):
        for j in range(2**W):
            cnt = 0
            for s in range(H):
                for t in range(W):
                    if (i >> s) & 1 and (j >> t) & 1 and C[s][t] == "#":
                        cnt += 1
            if cnt == K:
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-from copy import deepcopy -    C = [list(readline().strip()) for _ in range(H)] +    C = [readline().strip() for _ in range(H)] -    for i in range(2 ** (H + W)): -        c = deepcopy(C) -        for j in range(H + W): -            if (i >> j) & 1: -                if j < H: -                    for s in range(W): -                        c[j][s] = "." -                else: -                    for k in range(H): -                        c[k][j - H] = "." -        cnt = 0 -        for line in c: -            cnt += line.count("#") -        if cnt == K: -            ans += 1 +    for i in range(2**H): +        for j in range(2**W): +            cnt = 0 +            for s in range(H): +                for t in range(W): +                    if (i >> s) & 1 and (j >> t) & 1 and C[s][t] == "#": +                        cnt += 1 +            if cnt == K: +                ans += 1