import sys

def input(): return sys.stdin.readline().strip()

def mapint(): return list(map(int, input().split()))

sys.setrecursionlimit(10**9)



H, W, K = mapint()



rows = [0]*H

query = []

allcnt = 0

for h in range(H):

    Cs = list(eval(input()))

    query.append(Cs)

    cnt = sum([1 if i=='#' else 0 for i in Cs])

    rows[h] = cnt

    allcnt += cnt

ans = 0

for i in range(1<<H):

    skip = set()

    num = 0

    for h in range(H):

        if (i>>h)&1:

            skip.add(h)

            num += rows[h]

    for j in range(1<<W):

        num2 = num

        for w in range(W):

            if (j>>w)&1:

                for h2 in range(H):

                    if h2 in skip:

                        continue

                    if query[h2][w]=='#':

                        num2 += 1

        if allcnt-num2==K:

            ans += 1

print(ans)
import sys

def input(): return sys.stdin.readline().strip()

def mapint(): return list(map(int, input().split()))

sys.setrecursionlimit(10**9)



H, W, K = mapint()



query = [list(eval(input())) for _ in range(H)]

ans = 0

for i in range(1<<H):

    for j in range(1<<W):

        cnt = 0

        for h in range(H):

            for w in range(W):

                if not (i>>h)&1 and not (j>>w)&1:

                    if query[h][w]=='#':

                        cnt += 1

        if cnt==K:

            ans += 1



print(ans)
import sys


def input():
    return sys.stdin.readline().strip()


def mapint():
    return list(map(int, input().split()))


sys.setrecursionlimit(10**9)
H, W, K = mapint()
rows = [0] * H
query = []
allcnt = 0
for h in range(H):
    Cs = list(eval(input()))
    query.append(Cs)
    cnt = sum([1 if i == "#" else 0 for i in Cs])
    rows[h] = cnt
    allcnt += cnt
ans = 0
for i in range(1 << H):
    skip = set()
    num = 0
    for h in range(H):
        if (i >> h) & 1:
            skip.add(h)
            num += rows[h]
    for j in range(1 << W):
        num2 = num
        for w in range(W):
            if (j >> w) & 1:
                for h2 in range(H):
                    if h2 in skip:
                        continue
                    if query[h2][w] == "#":
                        num2 += 1
        if allcnt - num2 == K:
            ans += 1
print(ans)

import sys


def input():
    return sys.stdin.readline().strip()


def mapint():
    return list(map(int, input().split()))


sys.setrecursionlimit(10**9)
H, W, K = mapint()
query = [list(eval(input())) for _ in range(H)]
ans = 0
for i in range(1 << H):
    for j in range(1 << W):
        cnt = 0
        for h in range(H):
            for w in range(W):
                if not (i >> h) & 1 and not (j >> w) & 1:
                    if query[h][w] == "#":
                        cnt += 1
        if cnt == K:
            ans += 1
print(ans)

-rows = [0] * H -query = [] -allcnt = 0 -for h in range(H): -    Cs = list(eval(input())) -    query.append(Cs) -    cnt = sum([1 if i == "#" else 0 for i in Cs]) -    rows[h] = cnt -    allcnt += cnt +query = [list(eval(input())) for _ in range(H)] -    skip = set() -    num = 0 -    for h in range(H): -        if (i >> h) & 1: -            skip.add(h) -            num += rows[h] -        num2 = num -        for w in range(W): -            if (j >> w) & 1: -                for h2 in range(H): -                    if h2 in skip: -                        continue -                    if query[h2][w] == "#": -                        num2 += 1 -        if allcnt - num2 == K: +        cnt = 0 +        for h in range(H): +            for w in range(W): +                if not (i >> h) & 1 and not (j >> w) & 1: +                    if query[h][w] == "#": +                        cnt += 1 +        if cnt == K: