from collections import Counter



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

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



cnt = 0

for h in range(2**H):

    h_list = []

    for _ in range(H):

        h_list.append(h%2)

        h //= 2

    for w in range(2**W):

        w_list = []

        for _ in range(W):

            w_list.append(w%2)

            w //= 2

        tmp = []

        

        for i in range(H):

            for j in range(W):

                if h_list[i] == 0 and w_list[j] == 0:

                    tmp.append(c[i][j])

        

        tmp = Counter(tmp)

        if tmp['#'] == K:

            cnt += 1

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

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



cnt = 0

for rows in range(1 << H):

    for cols in range(1 << W):

        black = 0

        for i in range(H):

            if (rows >> i) % 2 == 1:

                continue

            for j in range(W):

                if (cols >> j) % 2 == 1:

                    continue

                black += c[i][j] == '#'

        if black == K:

            cnt += 1

print(cnt)
from collections import Counter

H, W, K = list(map(int, input().split()))
c = [eval(input()) for _ in range(H)]
cnt = 0
for h in range(2**H):
    h_list = []
    for _ in range(H):
        h_list.append(h % 2)
        h //= 2
    for w in range(2**W):
        w_list = []
        for _ in range(W):
            w_list.append(w % 2)
            w //= 2
        tmp = []
        for i in range(H):
            for j in range(W):
                if h_list[i] == 0 and w_list[j] == 0:
                    tmp.append(c[i][j])
        tmp = Counter(tmp)
        if tmp["#"] == K:
            cnt += 1
print(cnt)

H, W, K = list(map(int, input().split()))
c = [eval(input()) for _ in range(H)]
cnt = 0
for rows in range(1 << H):
    for cols in range(1 << W):
        black = 0
        for i in range(H):
            if (rows >> i) % 2 == 1:
                continue
            for j in range(W):
                if (cols >> j) % 2 == 1:
                    continue
                black += c[i][j] == "#"
        if black == K:
            cnt += 1
print(cnt)

-from collections import Counter - -for h in range(2**H): -    h_list = [] -    for _ in range(H): -        h_list.append(h % 2) -        h //= 2 -    for w in range(2**W): -        w_list = [] -        for _ in range(W): -            w_list.append(w % 2) -            w //= 2 -        tmp = [] +for rows in range(1 << H): +    for cols in range(1 << W): +        black = 0 +            if (rows >> i) % 2 == 1: +                continue -                if h_list[i] == 0 and w_list[j] == 0: -                    tmp.append(c[i][j]) -        tmp = Counter(tmp) -        if tmp["#"] == K: +                if (cols >> j) % 2 == 1: +                    continue +                black += c[i][j] == "#" +        if black == K: