import sys

input = sys.stdin.readline

from collections import *



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

c = [input()[:-1] for _ in range(H)]

row = []



for i in range(H):

    cnt = 0

    

    for j in range(W):

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

            cnt += 1

    

    row.append(cnt)



col = []



for i in range(W):

    cnt = 0

    

    for j in range(H):

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

            cnt += 1

    

    col.append(cnt)



total = sum(row)

ans = 0



for s1 in range(1<<H):

    for s2 in range(1<<W):

        l1, l2 = [], []

        

        for i in range(H):

            if (s1>>i)&1:

                l1.append(i)

        

        for i in range(W):

            if (s2>>i)&1:

                l2.append(i)

    

        now = total

        

        for l1i in l1:

            now -= row[l1i]

        

        for l2i in l2:

            now -= col[l2i]

            

        for l1i in l1:

            for l2i in l2:

                if c[l1i][l2i]=='#':

                    now += 1

        

        if now==K:

            ans += 1



print(ans)
import sys

input = sys.stdin.readline



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

c = [input()[:-1] for _ in range(H)]

ans = 0



for S in range(1<<H):

    for T in range(1<<W):

        cnt = 0

        

        for i in range(H):

            for j in range(W):

                if (S>>i)&1 or (T>>j)&1:

                    continue

                

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

                    cnt += 1

        

        if cnt==K:

            ans += 1



print(ans)
import sys

input = sys.stdin.readline
from collections import *

H, W, K = list(map(int, input().split()))
c = [input()[:-1] for _ in range(H)]
row = []
for i in range(H):
    cnt = 0
    for j in range(W):
        if c[i][j] == "#":
            cnt += 1
    row.append(cnt)
col = []
for i in range(W):
    cnt = 0
    for j in range(H):
        if c[j][i] == "#":
            cnt += 1
    col.append(cnt)
total = sum(row)
ans = 0
for s1 in range(1 << H):
    for s2 in range(1 << W):
        l1, l2 = [], []
        for i in range(H):
            if (s1 >> i) & 1:
                l1.append(i)
        for i in range(W):
            if (s2 >> i) & 1:
                l2.append(i)
        now = total
        for l1i in l1:
            now -= row[l1i]
        for l2i in l2:
            now -= col[l2i]
        for l1i in l1:
            for l2i in l2:
                if c[l1i][l2i] == "#":
                    now += 1
        if now == K:
            ans += 1
print(ans)

import sys

input = sys.stdin.readline
H, W, K = list(map(int, input().split()))
c = [input()[:-1] for _ in range(H)]
ans = 0
for S in range(1 << H):
    for T in range(1 << W):
        cnt = 0
        for i in range(H):
            for j in range(W):
                if (S >> i) & 1 or (T >> j) & 1:
                    continue
                if c[i][j] == "#":
                    cnt += 1
        if cnt == K:
            ans += 1
print(ans)

-from collections import * - -row = [] -for i in range(H): -    cnt = 0 -    for j in range(W): -        if c[i][j] == "#": -            cnt += 1 -    row.append(cnt) -col = [] -for i in range(W): -    cnt = 0 -    for j in range(H): -        if c[j][i] == "#": -            cnt += 1 -    col.append(cnt) -total = sum(row) -for s1 in range(1 << H): -    for s2 in range(1 << W): -        l1, l2 = [], [] +for S in range(1 << H): +    for T in range(1 << W): +        cnt = 0 -            if (s1 >> i) & 1: -                l1.append(i) -        for i in range(W): -            if (s2 >> i) & 1: -                l2.append(i) -        now = total -        for l1i in l1: -            now -= row[l1i] -        for l2i in l2: -            now -= col[l2i] -        for l1i in l1: -            for l2i in l2: -                if c[l1i][l2i] == "#": -                    now += 1 -        if now == K: +            for j in range(W): +                if (S >> i) & 1 or (T >> j) & 1: +                    continue +                if c[i][j] == "#": +                    cnt += 1 +        if cnt == K: