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

S=[eval(input()) for i in range(H)]

P=0

Q=0

for i in range(1<<H):

  for j in range(1<<W):

    Q=0

    for k in range(H):

      for l in range(W):

        if S[k][l]=='#' and i&(1<<k)!=0 and j&(1<<l)!=0:

          Q+=1

    if Q==K:

      P+=1

print(P)

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

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

DP=[0]*(K+1)

X=[]

P=0

for i in range(1,1<<H):

  X=[0]*W

  for j in range(H):

    if i&(1<<j):

      for k in range(W):

        if C[j][k]=='#':

          X[k]+=1

  for j in range(K+1):

    DP[j]=0

  DP[0]=1

  for j in range(W):

    for k in range(K,-1,-1):

      if k+X[j]<=K:

        DP[k+X[j]]+=DP[k]

  P+=DP[K]

print(P)
H, W, K = list(map(int, input().split()))
S = [eval(input()) for i in range(H)]
P = 0
Q = 0
for i in range(1 << H):
    for j in range(1 << W):
        Q = 0
        for k in range(H):
            for l in range(W):
                if S[k][l] == "#" and i & (1 << k) != 0 and j & (1 << l) != 0:
                    Q += 1
        if Q == K:
            P += 1
print(P)

H, W, K = list(map(int, input().split()))
C = [eval(input()) for i in range(H)]
DP = [0] * (K + 1)
X = []
P = 0
for i in range(1, 1 << H):
    X = [0] * W
    for j in range(H):
        if i & (1 << j):
            for k in range(W):
                if C[j][k] == "#":
                    X[k] += 1
    for j in range(K + 1):
        DP[j] = 0
    DP[0] = 1
    for j in range(W):
        for k in range(K, -1, -1):
            if k + X[j] <= K:
                DP[k + X[j]] += DP[k]
    P += DP[K]
print(P)

-S = [eval(input()) for i in range(H)] +C = [eval(input()) for i in range(H)] +DP = [0] * (K + 1) +X = [] -Q = 0 -for i in range(1 << H): -    for j in range(1 << W): -        Q = 0 -        for k in range(H): -            for l in range(W): -                if S[k][l] == "#" and i & (1 << k) != 0 and j & (1 << l) != 0: -                    Q += 1 -        if Q == K: -            P += 1 +for i in range(1, 1 << H): +    X = [0] * W +    for j in range(H): +        if i & (1 << j): +            for k in range(W): +                if C[j][k] == "#": +                    X[k] += 1 +    for j in range(K + 1): +        DP[j] = 0 +    DP[0] = 1 +    for j in range(W): +        for k in range(K, -1, -1): +            if k + X[j] <= K: +                DP[k + X[j]] += DP[k] +    P += DP[K]