import copy

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

c=[[[".","#"].index(i)for i in eval(input())]for j in range(h)]

l=0

for i in range(2**h):

    for j in range(2**w):

        x,y=bin(i)[2:].zfill(h),bin(j)[2:].zfill(w)

        a,b=[],[]

        for p in range(h):

            if x[p]=="1":

                a+=[p]

        for p in range(w):

            if y[p]=="1":

                b+=[p]

        d=copy.deepcopy(c)

        for x in a:

            d[x]=[2]*w

        for x in b:

            for y in range(h):

                d[y][x]=2

        p=[]

        for x in d:

            p+=x

        l+=(k==p.count(1))

print(l)
import copy

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

c=[[[".","#"].index(j)for j in list(eval(input()))]for i in range(h)]

p=0

for i in range(2**h):

    a=bin(i)[2:].zfill(h)

    for j in range(2**w):

        b=bin(j)[2:].zfill(w)

        d=copy.deepcopy(c)

        for x in range(w):

            if b[x]=="1":

                for y in range(h):

                    d[y][x]=0

        for x in range(h):

            if a[x]=="1":

                d[x]=[0]*w

        q=0

        for x in d:

            q+=sum(x)

        if q==k:

            p+=1

print(p)
import copy

h, w, k = list(map(int, input().split()))
c = [[[".", "#"].index(i) for i in eval(input())] for j in range(h)]
l = 0
for i in range(2**h):
    for j in range(2**w):
        x, y = bin(i)[2:].zfill(h), bin(j)[2:].zfill(w)
        a, b = [], []
        for p in range(h):
            if x[p] == "1":
                a += [p]
        for p in range(w):
            if y[p] == "1":
                b += [p]
        d = copy.deepcopy(c)
        for x in a:
            d[x] = [2] * w
        for x in b:
            for y in range(h):
                d[y][x] = 2
        p = []
        for x in d:
            p += x
        l += k == p.count(1)
print(l)

import copy

h, w, k = list(map(int, input().split()))
c = [[[".", "#"].index(j) for j in list(eval(input()))] for i in range(h)]
p = 0
for i in range(2**h):
    a = bin(i)[2:].zfill(h)
    for j in range(2**w):
        b = bin(j)[2:].zfill(w)
        d = copy.deepcopy(c)
        for x in range(w):
            if b[x] == "1":
                for y in range(h):
                    d[y][x] = 0
        for x in range(h):
            if a[x] == "1":
                d[x] = [0] * w
        q = 0
        for x in d:
            q += sum(x)
        if q == k:
            p += 1
print(p)

-c = [[[".", "#"].index(i) for i in eval(input())] for j in range(h)] -l = 0 +c = [[[".", "#"].index(j) for j in list(eval(input()))] for i in range(h)] +p = 0 +    a = bin(i)[2:].zfill(h) -        x, y = bin(i)[2:].zfill(h), bin(j)[2:].zfill(w) -        a, b = [], [] -        for p in range(h): -            if x[p] == "1": -                a += [p] -        for p in range(w): -            if y[p] == "1": -                b += [p] +        b = bin(j)[2:].zfill(w) -        for x in a: -            d[x] = [2] * w -        for x in b: -            for y in range(h): -                d[y][x] = 2 -        p = [] +        for x in range(w): +            if b[x] == "1": +                for y in range(h): +                    d[y][x] = 0 +        for x in range(h): +            if a[x] == "1": +                d[x] = [0] * w +        q = 0 -            p += x -        l += k == p.count(1) -print(l) +            q += sum(x) +        if q == k: +            p += 1 +print(p)