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

ans = 0

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

for hi in range(2**h):

	hl = []

	for hj in range(h):

		if (hi >> hj) & 1:

			hl.append(hj)

	tmp = s[:]

	for j in hl:

		tmp[j] = "."*w

	for wi in range(2**w):

		wl = []

		for wj in range(w):

			if (wi >> wj) & 1:

				wl.append(wj)

		cnt = 0

		for i in range(h):

			for j in range(w):

				if j not in wl:

					if tmp[i][j] == "#":

						cnt += 1

		if cnt == k:

			ans += 1

print(ans)
import itertools

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

ans = 0

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

for hi in itertools.product([0, 1], repeat=h):

	tmp = s[:]

	for j in range(h):

		if hi[j] == 1:

			tmp[j] = "."*w

	for wi in itertools.product([0, 1], repeat=w):

		cnt = 0

		for i in range(h):

			for j in range(w):

				if wi[j]:

					if tmp[i][j] == "#":

						cnt += 1

		if cnt == k:

			ans += 1

print(ans)

h, w, k = list(map(int, input().split()))
ans = 0
s = [eval(input()) for _ in range(h)]
for hi in range(2**h):
    hl = []
    for hj in range(h):
        if (hi >> hj) & 1:
            hl.append(hj)
    tmp = s[:]
    for j in hl:
        tmp[j] = "." * w
    for wi in range(2**w):
        wl = []
        for wj in range(w):
            if (wi >> wj) & 1:
                wl.append(wj)
        cnt = 0
        for i in range(h):
            for j in range(w):
                if j not in wl:
                    if tmp[i][j] == "#":
                        cnt += 1
        if cnt == k:
            ans += 1
print(ans)

import itertools

h, w, k = list(map(int, input().split()))
ans = 0
s = [eval(input()) for _ in range(h)]
for hi in itertools.product([0, 1], repeat=h):
    tmp = s[:]
    for j in range(h):
        if hi[j] == 1:
            tmp[j] = "." * w
    for wi in itertools.product([0, 1], repeat=w):
        cnt = 0
        for i in range(h):
            for j in range(w):
                if wi[j]:
                    if tmp[i][j] == "#":
                        cnt += 1
        if cnt == k:
            ans += 1
print(ans)

+import itertools + -for hi in range(2**h): -    hl = [] -    for hj in range(h): -        if (hi >> hj) & 1: -            hl.append(hj) +for hi in itertools.product([0, 1], repeat=h): -    for j in hl: -        tmp[j] = "." * w -    for wi in range(2**w): -        wl = [] -        for wj in range(w): -            if (wi >> wj) & 1: -                wl.append(wj) +    for j in range(h): +        if hi[j] == 1: +            tmp[j] = "." * w +    for wi in itertools.product([0, 1], repeat=w): -                if j not in wl: +                if wi[j]: