import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines





H,W,K = list(map(int,readline().split()))

C = [readline().strip() for _ in range(H)]



ans = 0

for i in range(2**H):

    for j in range(2**W):

        cnt = 0

        for s in range(H):

            for t in range(W):

                if (i >> s) & 1 and (j >> t) & 1 and C[s][t] == "#":

                    cnt += 1

        if cnt == K:

            ans += 1

print(ans)
import sys

 

def main():

  H,W,K = list(map(int,input().split()))

  a = []

  for i in range(H):

    a.append(sys.stdin.readline())

    

  ans = 0

  for i in range(2**H):

    for j in range(2**W):

      cnt = 0

      for s in range(H):

        for t in range(W):

          if(i >> s) & 1 and (j >> t) & 1 and a[s][t] == "#":

            cnt += 1

      if cnt == K :

        ans += 1

  print(ans)

  

if __name__ == "__main__":

  main()
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
H, W, K = list(map(int, readline().split()))
C = [readline().strip() for _ in range(H)]
ans = 0
for i in range(2**H):
    for j in range(2**W):
        cnt = 0
        for s in range(H):
            for t in range(W):
                if (i >> s) & 1 and (j >> t) & 1 and C[s][t] == "#":
                    cnt += 1
        if cnt == K:
            ans += 1
print(ans)

import sys


def main():
    H, W, K = list(map(int, input().split()))
    a = []
    for i in range(H):
        a.append(sys.stdin.readline())
    ans = 0
    for i in range(2**H):
        for j in range(2**W):
            cnt = 0
            for s in range(H):
                for t in range(W):
                    if (i >> s) & 1 and (j >> t) & 1 and a[s][t] == "#":
                        cnt += 1
            if cnt == K:
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-read = sys.stdin.read -readline = sys.stdin.readline -readlines = sys.stdin.readlines -H, W, K = list(map(int, readline().split())) -C = [readline().strip() for _ in range(H)] -ans = 0 -for i in range(2**H): -    for j in range(2**W): -        cnt = 0 -        for s in range(H): -            for t in range(W): -                if (i >> s) & 1 and (j >> t) & 1 and C[s][t] == "#": -                    cnt += 1 -        if cnt == K: -            ans += 1 -print(ans) + +def main(): +    H, W, K = list(map(int, input().split())) +    a = [] +    for i in range(H): +        a.append(sys.stdin.readline()) +    ans = 0 +    for i in range(2**H): +        for j in range(2**W): +            cnt = 0 +            for s in range(H): +                for t in range(W): +                    if (i >> s) & 1 and (j >> t) & 1 and a[s][t] == "#": +                        cnt += 1 +            if cnt == K: +                ans += 1 +    print(ans) + + +if __name__ == "__main__": +    main()