import copy

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

mas_global = [[] for _ in range(h)]

for i in range(h):

    mas_global[i] = list(eval(input()))



# a, bはh, wからどれを選ぶかの情報2進数

def calc_black_cnt(a, b):

    mas = copy.deepcopy(mas_global)

    i = 0

    while 1<<i <= a:

        if a & 1<<i != 0:

            mas[i] = ['r' for _ in range(w)]

        i += 1

    j = 0

    while 1<<j <= b:

        if b & 1<<j != 0:

            for ii in range(h):

                mas[ii][j] = 'r'

        j += 1

    res = 0

    for i in range(h):

        res += mas[i].count('#')

    return res



ans = 0

for i in range(2**h):

    for j in range(2**w):

        cnt = calc_black_cnt(i, j)

        if cnt == k:

            ans += 1

print(ans)

# calc_black_cnt(0, 4)
h, w, k = list(map(int, input().split()))

c = []

for _ in range(h):

    c.append(list(eval(input())))

def calc_black_cnt(maskR, maskC):

    cnt = 0

    for i in range(h):

        for j in range(w):

            if maskR>>i & 1 == 0 and maskC>>j & 1 == 0 and c[i][j] == '#':

                cnt += 1

    return cnt

ans = 0

for maskR in range(1<<h):

    for maskC in range(1<<w):

         if calc_black_cnt(maskR, maskC) == k:

                ans += 1

print(ans)
import copy

h, w, k = list(map(int, input().split()))
mas_global = [[] for _ in range(h)]
for i in range(h):
    mas_global[i] = list(eval(input()))
# a, bはh, wからどれを選ぶかの情報2進数
def calc_black_cnt(a, b):
    mas = copy.deepcopy(mas_global)
    i = 0
    while 1 << i <= a:
        if a & 1 << i != 0:
            mas[i] = ["r" for _ in range(w)]
        i += 1
    j = 0
    while 1 << j <= b:
        if b & 1 << j != 0:
            for ii in range(h):
                mas[ii][j] = "r"
        j += 1
    res = 0
    for i in range(h):
        res += mas[i].count("#")
    return res


ans = 0
for i in range(2**h):
    for j in range(2**w):
        cnt = calc_black_cnt(i, j)
        if cnt == k:
            ans += 1
print(ans)
# calc_black_cnt(0, 4)

h, w, k = list(map(int, input().split()))
c = []
for _ in range(h):
    c.append(list(eval(input())))


def calc_black_cnt(maskR, maskC):
    cnt = 0
    for i in range(h):
        for j in range(w):
            if maskR >> i & 1 == 0 and maskC >> j & 1 == 0 and c[i][j] == "#":
                cnt += 1
    return cnt


ans = 0
for maskR in range(1 << h):
    for maskC in range(1 << w):
        if calc_black_cnt(maskR, maskC) == k:
            ans += 1
print(ans)

-import copy +h, w, k = list(map(int, input().split())) +c = [] +for _ in range(h): +    c.append(list(eval(input()))) -h, w, k = list(map(int, input().split())) -mas_global = [[] for _ in range(h)] -for i in range(h): -    mas_global[i] = list(eval(input())) -# a, bはh, wからどれを選ぶかの情報2進数 -def calc_black_cnt(a, b): -    mas = copy.deepcopy(mas_global) -    i = 0 -    while 1 << i <= a: -        if a & 1 << i != 0: -            mas[i] = ["r" for _ in range(w)] -        i += 1 -    j = 0 -    while 1 << j <= b: -        if b & 1 << j != 0: -            for ii in range(h): -                mas[ii][j] = "r" -        j += 1 -    res = 0 + +def calc_black_cnt(maskR, maskC): +    cnt = 0 -        res += mas[i].count("#") -    return res +        for j in range(w): +            if maskR >> i & 1 == 0 and maskC >> j & 1 == 0 and c[i][j] == "#": +                cnt += 1 +    return cnt -for i in range(2**h): -    for j in range(2**w): -        cnt = calc_black_cnt(i, j) -        if cnt == k: +for maskR in range(1 << h): +    for maskC in range(1 << w): +        if calc_black_cnt(maskR, maskC) == k: -# calc_black_cnt(0, 4)