import itertools

import copy

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

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

num=0

for i in range(h):

    for j in range(w):

        if c[i][j]=='#':

            num+=1

ans=0

for a in range(1,h+1):

    for b in range(1,w+1):

        l=list(range(1,h+1))

        m=list(range(1,w+1))

        for p in itertools.combinations(l, a):

            for q in itertools.combinations(m, b):

                sum=0

                d=copy.deepcopy(c)

                for i in p:

                    for j in q:

                        for s in range(w):

                            if d[i-1][s]=='#':

                                sum+=1

                                d[i-1][s]='.'

                        for t in range(h):

                            if d[t][j-1]=='#':

                                sum+=1

                                d[t][j-1]='.'

                if num-sum==k:

                    ans+=1

for a in range(1,h+1):

        l=list(range(1,h+1))

        for p in itertools.combinations(l, a):

            sum=0

            d=copy.deepcopy(c)

            for i in p:

                for s in range(w):

                    if d[i-1][s]=='#':

                        sum+=1

                        d[i-1][s]='.'

            if num-sum==k:

                ans+=1

for b in range(1,w+1):

        m=list(range(1,w+1))

        for q in itertools.combinations(m, b):

            sum=0

            d=copy.deepcopy(c)

            for j in q:

                for t in range(h):

                    if d[t][j-1]=='#':

                        sum+=1

                        d[t][j-1]='.'

            if num-sum==k:

                ans+=1

if num==k:

    ans+=1

print(ans)
import copy

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

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



ans = 0

for row in range(1<<h):

    for col in range(1<<w):

        d = copy.deepcopy(c)

        sum = 0

        for i in range(h):

            if row & (1<<i):

                for j in range(w):

                    d[i][j] = '.'

        for j in range(w):

            if col & (1<<j):

                for i in range(h):

                    d[i][j] = '.'



        for i in range(h):

            for j in range(w):

                if d[i][j] == '#':

                    sum+=1

        if sum == k:

            ans+=1

print(ans)    







import itertools
import copy

h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for _ in range(h)]
num = 0
for i in range(h):
    for j in range(w):
        if c[i][j] == "#":
            num += 1
ans = 0
for a in range(1, h + 1):
    for b in range(1, w + 1):
        l = list(range(1, h + 1))
        m = list(range(1, w + 1))
        for p in itertools.combinations(l, a):
            for q in itertools.combinations(m, b):
                sum = 0
                d = copy.deepcopy(c)
                for i in p:
                    for j in q:
                        for s in range(w):
                            if d[i - 1][s] == "#":
                                sum += 1
                                d[i - 1][s] = "."
                        for t in range(h):
                            if d[t][j - 1] == "#":
                                sum += 1
                                d[t][j - 1] = "."
                if num - sum == k:
                    ans += 1
for a in range(1, h + 1):
    l = list(range(1, h + 1))
    for p in itertools.combinations(l, a):
        sum = 0
        d = copy.deepcopy(c)
        for i in p:
            for s in range(w):
                if d[i - 1][s] == "#":
                    sum += 1
                    d[i - 1][s] = "."
        if num - sum == k:
            ans += 1
for b in range(1, w + 1):
    m = list(range(1, w + 1))
    for q in itertools.combinations(m, b):
        sum = 0
        d = copy.deepcopy(c)
        for j in q:
            for t in range(h):
                if d[t][j - 1] == "#":
                    sum += 1
                    d[t][j - 1] = "."
        if num - sum == k:
            ans += 1
if num == k:
    ans += 1
print(ans)

import copy

h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for _ in range(h)]
ans = 0
for row in range(1 << h):
    for col in range(1 << w):
        d = copy.deepcopy(c)
        sum = 0
        for i in range(h):
            if row & (1 << i):
                for j in range(w):
                    d[i][j] = "."
        for j in range(w):
            if col & (1 << j):
                for i in range(h):
                    d[i][j] = "."
        for i in range(h):
            for j in range(w):
                if d[i][j] == "#":
                    sum += 1
        if sum == k:
            ans += 1
print(ans)

-import itertools -num = 0 -for i in range(h): -    for j in range(w): -        if c[i][j] == "#": -            num += 1 -for a in range(1, h + 1): -    for b in range(1, w + 1): -        l = list(range(1, h + 1)) -        m = list(range(1, w + 1)) -        for p in itertools.combinations(l, a): -            for q in itertools.combinations(m, b): -                sum = 0 -                d = copy.deepcopy(c) -                for i in p: -                    for j in q: -                        for s in range(w): -                            if d[i - 1][s] == "#": -                                sum += 1 -                                d[i - 1][s] = "." -                        for t in range(h): -                            if d[t][j - 1] == "#": -                                sum += 1 -                                d[t][j - 1] = "." -                if num - sum == k: -                    ans += 1 -for a in range(1, h + 1): -    l = list(range(1, h + 1)) -    for p in itertools.combinations(l, a): +for row in range(1 << h): +    for col in range(1 << w): +        d = copy.deepcopy(c) -        d = copy.deepcopy(c) -        for i in p: -            for s in range(w): -                if d[i - 1][s] == "#": +        for i in range(h): +            if row & (1 << i): +                for j in range(w): +                    d[i][j] = "." +        for j in range(w): +            if col & (1 << j): +                for i in range(h): +                    d[i][j] = "." +        for i in range(h): +            for j in range(w): +                if d[i][j] == "#": -                    d[i - 1][s] = "." -        if num - sum == k: +        if sum == k: -for b in range(1, w + 1): -    m = list(range(1, w + 1)) -    for q in itertools.combinations(m, b): -        sum = 0 -        d = copy.deepcopy(c) -        for j in q: -            for t in range(h): -                if d[t][j - 1] == "#": -                    sum += 1 -                    d[t][j - 1] = "." -        if num - sum == k: -            ans += 1 -if num == k: -    ans += 1