#c

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

s = [eval(input()) for i in range(h)]



def get_unique_list(seq):

    seen = []

    return [x for x in seq if x not in seen and not seen.append(x)]

ans = 0

count = 0

for i in range(h):

    count += s[i].count("#")



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

    bag = []

    for j in range(h+w):  # このループが一番のポイント

        if ((i >> j) & 1): 

            bag.append(j)

    d_count = []

    for p in bag:

        

        if p < h:#行

            for r in range(w):

                if s[p][r] == "#":

                    d_count.append([p,r])

        else:#列

            for c in range(h):

                if s[c][p-h] == "#":

                    d_count.append([c,p-h])

    if count - len(get_unique_list(d_count)) == k:

        ans += 1

print(ans)

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

s = [eval(input()) for i in range(h)]



ans = 0

for i in range(2 ** (h)):

    for j in range(2 ** (w)):

        bag = 0

        sharp = 0

        

        for l in range(h):

            for m in range(w):

                

                if s[l][m] == "#":

                    sharp +=1

                if ((i >> l)&1) or ((j>>m)&1):

                    if s[l][m] == "#":

                        bag += 1

                        

        if sharp - bag == k:

            ans += 1

                

print(ans)
# c
h, w, k = list(map(int, input().split()))
s = [eval(input()) for i in range(h)]


def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]


ans = 0
count = 0
for i in range(h):
    count += s[i].count("#")
for i in range(2 ** (h + w)):
    bag = []
    for j in range(h + w):  # このループが一番のポイント
        if (i >> j) & 1:
            bag.append(j)
    d_count = []
    for p in bag:
        if p < h:  # 行
            for r in range(w):
                if s[p][r] == "#":
                    d_count.append([p, r])
        else:  # 列
            for c in range(h):
                if s[c][p - h] == "#":
                    d_count.append([c, p - h])
    if count - len(get_unique_list(d_count)) == k:
        ans += 1
print(ans)

h, w, k = list(map(int, input().split()))
s = [eval(input()) for i in range(h)]
ans = 0
for i in range(2 ** (h)):
    for j in range(2 ** (w)):
        bag = 0
        sharp = 0
        for l in range(h):
            for m in range(w):
                if s[l][m] == "#":
                    sharp += 1
                if ((i >> l) & 1) or ((j >> m) & 1):
                    if s[l][m] == "#":
                        bag += 1
        if sharp - bag == k:
            ans += 1
print(ans)

-# c - - -def get_unique_list(seq): -    seen = [] -    return [x for x in seq if x not in seen and not seen.append(x)] - - -count = 0 -for i in range(h): -    count += s[i].count("#") -for i in range(2 ** (h + w)): -    bag = [] -    for j in range(h + w):  # このループが一番のポイント -        if (i >> j) & 1: -            bag.append(j) -    d_count = [] -    for p in bag: -        if p < h:  # 行 -            for r in range(w): -                if s[p][r] == "#": -                    d_count.append([p, r]) -        else:  # 列 -            for c in range(h): -                if s[c][p - h] == "#": -                    d_count.append([c, p - h]) -    if count - len(get_unique_list(d_count)) == k: -        ans += 1 +for i in range(2 ** (h)): +    for j in range(2 ** (w)): +        bag = 0 +        sharp = 0 +        for l in range(h): +            for m in range(w): +                if s[l][m] == "#": +                    sharp += 1 +                if ((i >> l) & 1) or ((j >> m) & 1): +                    if s[l][m] == "#": +                        bag += 1 +        if sharp - bag == k: +            ans += 1