import itertools

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

g = []

for _ in range(h):

  i = eval(input())

  g.append(i)

l = [0 for j in range(h)]

d = [0 for j in range(w)]

c =0

for i in range(h):

  a = 0

  for j in range(w):

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

      a +=1

  l[i]+=a

  c+=a

for i in range(w):

  b = 0

  for j in range(h):

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

      b +=1

  d[i]+=b

ans = 0

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

  e = c

  for x in range(h):

    if i[x] == 1:

      e-= l[x]

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

    f = e

    for y in range(w):

      if j[y] == 1:

        f -= d[y]

    for x in range(h):

      for y in range(w):

        if i[x] == 1 and j[y] == 1 and g[x][y]=='#':

          f+=1

    if f==k:

      ans+=1

print(ans)
import itertools

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

g = []

for _ in range(h):

  g.append(eval(input()))

ans = 0

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

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

    e = 0

    for x in range(h):

      for y in range(w):

        if i[x] == 1 and j[y] == 1 and g[x][y]=='#':

          e+=1

    if e==k:

      ans+=1

print(ans)
import itertools

h, w, k = list(map(int, input().split()))
g = []
for _ in range(h):
    i = eval(input())
    g.append(i)
l = [0 for j in range(h)]
d = [0 for j in range(w)]
c = 0
for i in range(h):
    a = 0
    for j in range(w):
        if g[i][j] == "#":
            a += 1
    l[i] += a
    c += a
for i in range(w):
    b = 0
    for j in range(h):
        if g[j][i] == "#":
            b += 1
    d[i] += b
ans = 0
for i in list(itertools.product([0, 1], repeat=h)):
    e = c
    for x in range(h):
        if i[x] == 1:
            e -= l[x]
    for j in list(itertools.product([0, 1], repeat=w)):
        f = e
        for y in range(w):
            if j[y] == 1:
                f -= d[y]
        for x in range(h):
            for y in range(w):
                if i[x] == 1 and j[y] == 1 and g[x][y] == "#":
                    f += 1
        if f == k:
            ans += 1
print(ans)

import itertools

h, w, k = list(map(int, input().split()))
g = []
for _ in range(h):
    g.append(eval(input()))
ans = 0
for i in list(itertools.product([0, 1], repeat=h)):
    for j in list(itertools.product([0, 1], repeat=w)):
        e = 0
        for x in range(h):
            for y in range(w):
                if i[x] == 1 and j[y] == 1 and g[x][y] == "#":
                    e += 1
        if e == k:
            ans += 1
print(ans)

-    i = eval(input()) -    g.append(i) -l = [0 for j in range(h)] -d = [0 for j in range(w)] -c = 0 -for i in range(h): -    a = 0 -    for j in range(w): -        if g[i][j] == "#": -            a += 1 -    l[i] += a -    c += a -for i in range(w): -    b = 0 -    for j in range(h): -        if g[j][i] == "#": -            b += 1 -    d[i] += b +    g.append(eval(input())) -    e = c -    for x in range(h): -        if i[x] == 1: -            e -= l[x] -        f = e -        for y in range(w): -            if j[y] == 1: -                f -= d[y] +        e = 0 -                    f += 1 -        if f == k: +                    e += 1 +        if e == k: