import itertools

import copy

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

C = [list(eval(input())) for i in range(h)]

ans = 0

for i in range(h+1):

  for j in range(w+1):

    for high in itertools.combinations(list(range(h)),i):

      for width in itertools.combinations(list(range(w)),j):

        C2 = copy.deepcopy(C)

        for hi in high:

          for l in range(w):

            C2[hi][l] = "."

        for wi in width:

          for m in range(h):

            C2[m][wi] = "."

        C2 = list(itertools.chain.from_iterable(C2))

        if C2.count("#") == k:

          ans += 1

print(ans)
import itertools,copy

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

C = [list(eval(input())) for i in range(h)]

ans = 0

for bith in range(2**h):

  for bitw in range(2**w):

    Ccopy = copy.deepcopy(C)

    for high in range(h):

      if (1 & bith>>high):

        for i in range(w):

          Ccopy[high][i] = "."

    for width in range(w):

      if (1 & bitw>>width):

        for i in range(h):

          Ccopy[i][width] = "."

    if list(itertools.chain.from_iterable(Ccopy)).count("#") == k:

      ans += 1

print(ans)

import itertools
import copy

h, w, k = list(map(int, input().split()))
C = [list(eval(input())) for i in range(h)]
ans = 0
for i in range(h + 1):
    for j in range(w + 1):
        for high in itertools.combinations(list(range(h)), i):
            for width in itertools.combinations(list(range(w)), j):
                C2 = copy.deepcopy(C)
                for hi in high:
                    for l in range(w):
                        C2[hi][l] = "."
                for wi in width:
                    for m in range(h):
                        C2[m][wi] = "."
                C2 = list(itertools.chain.from_iterable(C2))
                if C2.count("#") == k:
                    ans += 1
print(ans)

import itertools, copy

h, w, k = list(map(int, input().split()))
C = [list(eval(input())) for i in range(h)]
ans = 0
for bith in range(2**h):
    for bitw in range(2**w):
        Ccopy = copy.deepcopy(C)
        for high in range(h):
            if 1 & bith >> high:
                for i in range(w):
                    Ccopy[high][i] = "."
        for width in range(w):
            if 1 & bitw >> width:
                for i in range(h):
                    Ccopy[i][width] = "."
        if list(itertools.chain.from_iterable(Ccopy)).count("#") == k:
            ans += 1
print(ans)

-import itertools -import copy +import itertools, copy -for i in range(h + 1): -    for j in range(w + 1): -        for high in itertools.combinations(list(range(h)), i): -            for width in itertools.combinations(list(range(w)), j): -                C2 = copy.deepcopy(C) -                for hi in high: -                    for l in range(w): -                        C2[hi][l] = "." -                for wi in width: -                    for m in range(h): -                        C2[m][wi] = "." -                C2 = list(itertools.chain.from_iterable(C2)) -                if C2.count("#") == k: -                    ans += 1 +for bith in range(2**h): +    for bitw in range(2**w): +        Ccopy = copy.deepcopy(C) +        for high in range(h): +            if 1 & bith >> high: +                for i in range(w): +                    Ccopy[high][i] = "." +        for width in range(w): +            if 1 & bitw >> width: +                for i in range(h): +                    Ccopy[i][width] = "." +        if list(itertools.chain.from_iterable(Ccopy)).count("#") == k: +            ans += 1