import copy



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

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

ans=0

boards=[]

for i in range(2**h):

  tmp=copy.deepcopy(board)

  bit1=format(i,'b')

  bit1='0'*(h-len(bit1))+bit1

  for th in range(h):

    if bit1[th]=='0':

      continue

    for tw in range(w):

      tmp[th][tw]='.'

  boards.append(tmp)

for i in range(len(boards)):

  for j in range(2**w):

    tmp=copy.deepcopy(boards[i])

    bit2=format(j,'b')

    bit2='0'*(w-len(bit2))+bit2

    for tw in range(w):

      if bit2[tw]=='0':

        continue

      for th in range(h):

        tmp[th][tw]='.'

    cnt=0

    for th in range(h):

      for tw in range(w):

        if tmp[th][tw]=='#':

          cnt+=1

    if cnt==k:

      ans+=1

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

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

ans=0

for paint_h in range(2**h):

  for paint_w in range(2**w):

    cnt=0

    for i in range(h):

      for j in range(w):

        if (paint_h>>i)&1==0 and (paint_w>>j)&1==0 and board[i][j]=='#':

          cnt+=1

    if cnt==k:

      ans+=1

print(ans)
import copy

h, w, k = list(map(int, input().split()))
board = [list(eval(input())) for _ in range(h)]
ans = 0
boards = []
for i in range(2**h):
    tmp = copy.deepcopy(board)
    bit1 = format(i, "b")
    bit1 = "0" * (h - len(bit1)) + bit1
    for th in range(h):
        if bit1[th] == "0":
            continue
        for tw in range(w):
            tmp[th][tw] = "."
    boards.append(tmp)
for i in range(len(boards)):
    for j in range(2**w):
        tmp = copy.deepcopy(boards[i])
        bit2 = format(j, "b")
        bit2 = "0" * (w - len(bit2)) + bit2
        for tw in range(w):
            if bit2[tw] == "0":
                continue
            for th in range(h):
                tmp[th][tw] = "."
        cnt = 0
        for th in range(h):
            for tw in range(w):
                if tmp[th][tw] == "#":
                    cnt += 1
        if cnt == k:
            ans += 1
print(ans)

h, w, k = list(map(int, input().split()))
board = [list(eval(input())) for _ in range(h)]
ans = 0
for paint_h in range(2**h):
    for paint_w in range(2**w):
        cnt = 0
        for i in range(h):
            for j in range(w):
                if (
                    (paint_h >> i) & 1 == 0
                    and (paint_w >> j) & 1 == 0
                    and board[i][j] == "#"
                ):
                    cnt += 1
        if cnt == k:
            ans += 1
print(ans)

-import copy - -boards = [] -for i in range(2**h): -    tmp = copy.deepcopy(board) -    bit1 = format(i, "b") -    bit1 = "0" * (h - len(bit1)) + bit1 -    for th in range(h): -        if bit1[th] == "0": -            continue -        for tw in range(w): -            tmp[th][tw] = "." -    boards.append(tmp) -for i in range(len(boards)): -    for j in range(2**w): -        tmp = copy.deepcopy(boards[i]) -        bit2 = format(j, "b") -        bit2 = "0" * (w - len(bit2)) + bit2 -        for tw in range(w): -            if bit2[tw] == "0": -                continue -            for th in range(h): -                tmp[th][tw] = "." +for paint_h in range(2**h): +    for paint_w in range(2**w): -        for th in range(h): -            for tw in range(w): -                if tmp[th][tw] == "#": +        for i in range(h): +            for j in range(w): +                if ( +                    (paint_h >> i) & 1 == 0 +                    and (paint_w >> j) & 1 == 0 +                    and board[i][j] == "#" +                ):