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

c = []

for i in range(H):

    row = eval(input())

    c.append(row)



a1 = []

a2 = []





def f():

    pass





at1 = [None] * H





def dfs1(pos: int):

    if pos == H:

        # print(a)

        a1.append(at1.copy())

        return



    at1[pos] = 0

    dfs1(pos + 1)



    at1[pos] = 1

    dfs1(pos + 1)





at2 = [None] * W





def dfs2(pos: int):

    if pos == W:

        # print(a)

        a2.append(at2.copy())

        return



    at2[pos] = 0

    dfs2(pos + 1)



    at2[pos] = 1

    dfs2(pos + 1)





dfs1(0)

dfs2(0)



# print(a1)

# print(a2)



ans = 0



for ai in a1:

    for aj in a2:

        g = []

        for i in range(H):

            arr = [None] * W

            g.append(arr)



        for i, aii in enumerate(ai):

            if aii == 1:

                g[i] = ['r'] * W



        for i, aji in enumerate(aj):

            if aji == 1:

                for j in range(H):

                    g[j][i] = 'r'



        # print(ai, aj, g)



        # count

        cnt = 0

        for i, row in enumerate(g):

            for j, col in enumerate(row):

                if col is None:

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

                        cnt += 1



        if cnt == K:

            ans += 1



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

s = []

for i in range(H):

    row = eval(input())

    s.append(row)



ans = 0

for i in range(1 << H):

    for j in range(1 << W):

        cnt = 0

        for hi in range(H):

            for wi in range(W):

                if i >> hi & 1:

                    continue

                if j >> wi & 1:

                    continue

                if s[hi][wi] == '#':

                    cnt += 1

        if cnt == K:

            ans += 1



print(ans)

H, W, K = list(map(int, input().split()))
c = []
for i in range(H):
    row = eval(input())
    c.append(row)
a1 = []
a2 = []


def f():
    pass


at1 = [None] * H


def dfs1(pos: int):
    if pos == H:
        # print(a)
        a1.append(at1.copy())
        return
    at1[pos] = 0
    dfs1(pos + 1)
    at1[pos] = 1
    dfs1(pos + 1)


at2 = [None] * W


def dfs2(pos: int):
    if pos == W:
        # print(a)
        a2.append(at2.copy())
        return
    at2[pos] = 0
    dfs2(pos + 1)
    at2[pos] = 1
    dfs2(pos + 1)


dfs1(0)
dfs2(0)
# print(a1)
# print(a2)
ans = 0
for ai in a1:
    for aj in a2:
        g = []
        for i in range(H):
            arr = [None] * W
            g.append(arr)
        for i, aii in enumerate(ai):
            if aii == 1:
                g[i] = ["r"] * W
        for i, aji in enumerate(aj):
            if aji == 1:
                for j in range(H):
                    g[j][i] = "r"
        # print(ai, aj, g)
        # count
        cnt = 0
        for i, row in enumerate(g):
            for j, col in enumerate(row):
                if col is None:
                    if c[i][j] == "#":
                        cnt += 1
        if cnt == K:
            ans += 1
print(ans)

H, W, K = list(map(int, input().split()))
s = []
for i in range(H):
    row = eval(input())
    s.append(row)
ans = 0
for i in range(1 << H):
    for j in range(1 << W):
        cnt = 0
        for hi in range(H):
            for wi in range(W):
                if i >> hi & 1:
                    continue
                if j >> wi & 1:
                    continue
                if s[hi][wi] == "#":
                    cnt += 1
        if cnt == K:
            ans += 1
print(ans)

-c = [] +s = [] -    c.append(row) -a1 = [] -a2 = [] - - -def f(): -    pass - - -at1 = [None] * H - - -def dfs1(pos: int): -    if pos == H: -        # print(a) -        a1.append(at1.copy()) -        return -    at1[pos] = 0 -    dfs1(pos + 1) -    at1[pos] = 1 -    dfs1(pos + 1) - - -at2 = [None] * W - - -def dfs2(pos: int): -    if pos == W: -        # print(a) -        a2.append(at2.copy()) -        return -    at2[pos] = 0 -    dfs2(pos + 1) -    at2[pos] = 1 -    dfs2(pos + 1) - - -dfs1(0) -dfs2(0) -# print(a1) -# print(a2) +    s.append(row) -for ai in a1: -    for aj in a2: -        g = [] -        for i in range(H): -            arr = [None] * W -            g.append(arr) -        for i, aii in enumerate(ai): -            if aii == 1: -                g[i] = ["r"] * W -        for i, aji in enumerate(aj): -            if aji == 1: -                for j in range(H): -                    g[j][i] = "r" -        # print(ai, aj, g) -        # count +for i in range(1 << H): +    for j in range(1 << W): -        for i, row in enumerate(g): -            for j, col in enumerate(row): -                if col is None: -                    if c[i][j] == "#": -                        cnt += 1 +        for hi in range(H): +            for wi in range(W): +                if i >> hi & 1: +                    continue +                if j >> wi & 1: +                    continue +                if s[hi][wi] == "#": +                    cnt += 1