from itertools import combinations

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

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

ans = 0

for i in range(1 << H):

    hs = []

    for h in range(H):

        if (i >> h) & 1:

            hs.append(h)

    for j in range(1 << W):

        ws = []

        for w in range(W):

            if (j >> w) & 1:

                ws.append(w)

        tmp = 0

        for h in range(H):

            if h in hs:

                continue

            for w in range(W):

                if w in ws:

                    continue

                tmp += C[h][w] == '#'

        if tmp == K:

            ans += 1



print(ans)
from itertools import combinations

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

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

res = 0

for i in range(1 << H):

    for j in range(1 << W):

        tmp = 0

        for h in range(H):

            if (i >> h) & 1:

                continue

            for w in range(W):

                if (j >> w) & 1:

                    continue

                tmp += C[h][w] == '#'

        if tmp == K:

            res += 1

print(res)
from itertools import combinations

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

from itertools import combinations

H, W, K = list(map(int, input().split()))
C = [eval(input()) for _ in range(H)]
res = 0
for i in range(1 << H):
    for j in range(1 << W):
        tmp = 0
        for h in range(H):
            if (i >> h) & 1:
                continue
            for w in range(W):
                if (j >> w) & 1:
                    continue
                tmp += C[h][w] == "#"
        if tmp == K:
            res += 1
print(res)

-ans = 0 +res = 0 -    hs = [] -    for h in range(H): -        if (i >> h) & 1: -            hs.append(h) -        ws = [] -        for w in range(W): -            if (j >> w) & 1: -                ws.append(w) -            if h in hs: +            if (i >> h) & 1: -                if w in ws: +                if (j >> w) & 1: -            ans += 1 -print(ans) +            res += 1 +print(res)