import copy

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

v=[]

for _ in range(h):

    array=list(eval(input()))

    v.append(array)

ans=0

for a in range(2**h):

    c=copy.deepcopy(v)

    for b in range(h):

        if a>>b & 1:

            for d in range(w):

                c[b][d]=0

    for e in range(2**w):

      z=copy.deepcopy(c)

      temp=0

      for f in range(w):

        if e>>f & 1:

          for g in range(h):

            z[g][f]=0

      for p in range(h):

        temp+=z[p].count("#")

      if temp==k:

        ans+=1

print(ans)
from itertools import product

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

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

ans=0

for i in product([0,1],repeat=h):

  for j in product([0,1],repeat=w):

    temp=0

    for m in range(h):

      for n in range(w):

        if i[m]==0 and j[n]==0 and c[m][n]=="#":

          temp+=1

    if temp==k:

      ans+=1

print(ans)

        

        
import copy

h, w, k = list(map(int, input().split()))
v = []
for _ in range(h):
    array = list(eval(input()))
    v.append(array)
ans = 0
for a in range(2**h):
    c = copy.deepcopy(v)
    for b in range(h):
        if a >> b & 1:
            for d in range(w):
                c[b][d] = 0
    for e in range(2**w):
        z = copy.deepcopy(c)
        temp = 0
        for f in range(w):
            if e >> f & 1:
                for g in range(h):
                    z[g][f] = 0
        for p in range(h):
            temp += z[p].count("#")
        if temp == k:
            ans += 1
print(ans)

from itertools import product

h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for _ in range(h)]
ans = 0
for i in product([0, 1], repeat=h):
    for j in product([0, 1], repeat=w):
        temp = 0
        for m in range(h):
            for n in range(w):
                if i[m] == 0 and j[n] == 0 and c[m][n] == "#":
                    temp += 1
        if temp == k:
            ans += 1
print(ans)

-import copy +from itertools import product -v = [] -for _ in range(h): -    array = list(eval(input())) -    v.append(array) +c = [list(eval(input())) for _ in range(h)] -for a in range(2**h): -    c = copy.deepcopy(v) -    for b in range(h): -        if a >> b & 1: -            for d in range(w): -                c[b][d] = 0 -    for e in range(2**w): -        z = copy.deepcopy(c) +for i in product([0, 1], repeat=h): +    for j in product([0, 1], repeat=w): -        for f in range(w): -            if e >> f & 1: -                for g in range(h): -                    z[g][f] = 0 -        for p in range(h): -            temp += z[p].count("#") +        for m in range(h): +            for n in range(w): +                if i[m] == 0 and j[n] == 0 and c[m][n] == "#": +                    temp += 1