import copy



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

ans = 0



c = []

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

  l = eval(input())

  for j in range(len(l)):

    if l[j] == "#":

      c.append((i, j+1))



combs = []

n_comb = 2**(h+w)

for n in range(n_comb):

  combs.append(format(n, f"0{h+w}b"))



for comb in combs:

  cc = copy.copy(c)

  h_choice = comb[:h]

  w_choice = comb[h:]

  for n, i in enumerate(h_choice):

    if i == "1":

      cc = [cell for cell in cc if cell[0] != n+1]

  for n, j in enumerate(w_choice):

    if j == "1":

      cc = [cell for cell in cc if cell[1] != n+1]

      

  if len(cc) == k:

    ans += 1

    

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

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

ans = 0



for rows in range(1 << h):

  for cols in range(1 << w):

    black = 0

    for i in range(h):

      if (rows >> i) & 1:

        continue

      for j in range(w):

        if (cols >> j) & 1:

          continue

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

    if black == k:

      ans += 1

      

print(ans)
import copy

h, w, k = list(map(int, input().split()))
ans = 0
c = []
for i in range(1, h + 1):
    l = eval(input())
    for j in range(len(l)):
        if l[j] == "#":
            c.append((i, j + 1))
combs = []
n_comb = 2 ** (h + w)
for n in range(n_comb):
    combs.append(format(n, f"0{h+w}b"))
for comb in combs:
    cc = copy.copy(c)
    h_choice = comb[:h]
    w_choice = comb[h:]
    for n, i in enumerate(h_choice):
        if i == "1":
            cc = [cell for cell in cc if cell[0] != n + 1]
    for n, j in enumerate(w_choice):
        if j == "1":
            cc = [cell for cell in cc if cell[1] != n + 1]
    if len(cc) == k:
        ans += 1
print(ans)

h, w, k = list(map(int, input().split()))
c = [eval(input()) for j in range(h)]
ans = 0
for rows in range(1 << h):
    for cols in range(1 << w):
        black = 0
        for i in range(h):
            if (rows >> i) & 1:
                continue
            for j in range(w):
                if (cols >> j) & 1:
                    continue
                black += c[i][j] == "#"
        if black == k:
            ans += 1
print(ans)

-import copy - +c = [eval(input()) for j in range(h)] -c = [] -for i in range(1, h + 1): -    l = eval(input()) -    for j in range(len(l)): -        if l[j] == "#": -            c.append((i, j + 1)) -combs = [] -n_comb = 2 ** (h + w) -for n in range(n_comb): -    combs.append(format(n, f"0{h+w}b")) -for comb in combs: -    cc = copy.copy(c) -    h_choice = comb[:h] -    w_choice = comb[h:] -    for n, i in enumerate(h_choice): -        if i == "1": -            cc = [cell for cell in cc if cell[0] != n + 1] -    for n, j in enumerate(w_choice): -        if j == "1": -            cc = [cell for cell in cc if cell[1] != n + 1] -    if len(cc) == k: -        ans += 1 +for rows in range(1 << h): +    for cols in range(1 << w): +        black = 0 +        for i in range(h): +            if (rows >> i) & 1: +                continue +            for j in range(w): +                if (cols >> j) & 1: +                    continue +                black += c[i][j] == "#" +        if black == k: +            ans += 1