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:

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

            cnt+=1

    if cnt==k:

      ans+=1

print(ans)
import itertools



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

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

ans=0

for bit_col in itertools.product(list(range(2)),repeat=h):

  for bit_row in itertools.product(list(range(2)),repeat=w):

    cnt=0

    for i in range(h):

      for j in range(w):

        if bit_col[i]==0 and bit_row[j]==0 and board[i][j]=='#':

          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:
                    if board[i][j] == "#":
                        cnt += 1
        if cnt == k:
            ans += 1
print(ans)

import itertools

h, w, k = list(map(int, input().split()))
board = [list(eval(input())) for _ in range(h)]
ans = 0
for bit_col in itertools.product(list(range(2)), repeat=h):
    for bit_row in itertools.product(list(range(2)), repeat=w):
        cnt = 0
        for i in range(h):
            for j in range(w):
                if bit_col[i] == 0 and bit_row[j] == 0 and board[i][j] == "#":
                    cnt += 1
        if cnt == k:
            ans += 1
print(ans)

+import itertools + -for paint_h in range(2**h): -    for paint_w in range(2**w): +for bit_col in itertools.product(list(range(2)), repeat=h): +    for bit_row in itertools.product(list(range(2)), repeat=w): -                if (paint_h >> i) & 1 == 0 and (paint_w >> j) & 1 == 0: -                    if board[i][j] == "#": -                        cnt += 1 +                if bit_col[i] == 0 and bit_row[j] == 0 and board[i][j] == "#": +                    cnt += 1