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

g = [eval(input()) for _ in range(H)]

ans = 0

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

    cnt = 0

    for h in range(H):

        if (bit & (h << 1)):

            pass

        if ((bit >> h) & 1):

            #print(h,"cancel")

            continue

        for w in range(W):

            if (bit & (H + w << 1)):

                pass

            if ((bit >> H + w) & 1):

                continue

            if g[h][w] == '#':

                cnt += 1

                #print(h, w)

    if cnt == K:

        # print(bin(bit), "ok")

        # for i in range(H):

        #     print(g[i])

        ans += 1

print(ans)

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

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

ans = 0

for bit in range(2**(h+w)):

    cnt = 0

    for hh in range(h):

        if ((bit >> hh) & 1):

            continue

        for ww in range(w):

            if ((bit >> h + ww) & 1):

                continue

            if g[hh][ww] == '#':

                cnt += 1

    if cnt == k:

        ans += 1

print(ans)

H, W, K = list(map(int, input().split()))
g = [eval(input()) for _ in range(H)]
ans = 0
for bit in range(2 ** (H + W)):
    cnt = 0
    for h in range(H):
        if bit & (h << 1):
            pass
        if (bit >> h) & 1:
            # print(h,"cancel")
            continue
        for w in range(W):
            if bit & (H + w << 1):
                pass
            if (bit >> H + w) & 1:
                continue
            if g[h][w] == "#":
                cnt += 1
                # print(h, w)
    if cnt == K:
        # print(bin(bit), "ok")
        # for i in range(H):
        #     print(g[i])
        ans += 1
print(ans)

h, w, k = list(map(int, input().split()))
g = [eval(input()) for _ in range(h)]
ans = 0
for bit in range(2 ** (h + w)):
    cnt = 0
    for hh in range(h):
        if (bit >> hh) & 1:
            continue
        for ww in range(w):
            if (bit >> h + ww) & 1:
                continue
            if g[hh][ww] == "#":
                cnt += 1
    if cnt == k:
        ans += 1
print(ans)

-H, W, K = list(map(int, input().split())) -g = [eval(input()) for _ in range(H)] +h, w, k = list(map(int, input().split())) +g = [eval(input()) for _ in range(h)] -for bit in range(2 ** (H + W)): +for bit in range(2 ** (h + w)): -    for h in range(H): -        if bit & (h << 1): -            pass -        if (bit >> h) & 1: -            # print(h,"cancel") +    for hh in range(h): +        if (bit >> hh) & 1: -        for w in range(W): -            if bit & (H + w << 1): -                pass -            if (bit >> H + w) & 1: +        for ww in range(w): +            if (bit >> h + ww) & 1: -            if g[h][w] == "#": +            if g[hh][ww] == "#": -                # print(h, w) -    if cnt == K: -        # print(bin(bit), "ok") -        # for i in range(H): -        #     print(g[i]) +    if cnt == k: