import io,sys,copy

sys.setrecursionlimit(10**6)





def main():

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

    G = []

    for _ in range(h):

        s = eval(input())

        temp = []

        for i in s:

            temp.append(i)

        G.append(temp)

    

    ans = 0

    for i in range(0b1<<w):

        for j in range(0b1<<h):

            G_sub = copy.deepcopy(G)

            s = i

            k = 0

            while s > 0:

                r = s%2

                s = s//2

                if r == 1:

                    for y in range(h):

                        G_sub[y][k] = "%"

                k+=1

            

            s = j

            k = 0

            while s > 0:

                r = s%2

                s = s//2

                if r == 1:

                    for x in range(w):

                        G_sub[k][x] = "%"

                k+=1

            

            ct = 0

            for g in G_sub:

                ct+=g.count("#")

            if ct == poi:

                ans+=1

    

    print(ans)

main()
def main2():

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

    G = []

    for _ in range(h):

        c = list(eval(input()))

        G.append(c)

    ans = 0



    for ib in range(1<<h):

        for jb in range(1<<w):

            ct = 0

            for i in range(h):

                for j in range(w):

                    if (ib>>i)&1 and (jb>>j)&1 and G[i][j]=="#":

                        ct+=1

            

            if ct == k:

                ans+=1

    

    print(ans)

main2()
import io, sys, copy

sys.setrecursionlimit(10**6)


def main():
    h, w, poi = list(map(int, input().split()))
    G = []
    for _ in range(h):
        s = eval(input())
        temp = []
        for i in s:
            temp.append(i)
        G.append(temp)
    ans = 0
    for i in range(0b1 << w):
        for j in range(0b1 << h):
            G_sub = copy.deepcopy(G)
            s = i
            k = 0
            while s > 0:
                r = s % 2
                s = s // 2
                if r == 1:
                    for y in range(h):
                        G_sub[y][k] = "%"
                k += 1
            s = j
            k = 0
            while s > 0:
                r = s % 2
                s = s // 2
                if r == 1:
                    for x in range(w):
                        G_sub[k][x] = "%"
                k += 1
            ct = 0
            for g in G_sub:
                ct += g.count("#")
            if ct == poi:
                ans += 1
    print(ans)


main()

def main2():
    h, w, k = list(map(int, input().split()))
    G = []
    for _ in range(h):
        c = list(eval(input()))
        G.append(c)
    ans = 0
    for ib in range(1 << h):
        for jb in range(1 << w):
            ct = 0
            for i in range(h):
                for j in range(w):
                    if (ib >> i) & 1 and (jb >> j) & 1 and G[i][j] == "#":
                        ct += 1
            if ct == k:
                ans += 1
    print(ans)


main2()

-import io, sys, copy - -sys.setrecursionlimit(10**6) - - -def main(): -    h, w, poi = list(map(int, input().split())) +def main2(): +    h, w, k = list(map(int, input().split())) -        s = eval(input()) -        temp = [] -        for i in s: -            temp.append(i) -        G.append(temp) +        c = list(eval(input())) +        G.append(c) -    for i in range(0b1 << w): -        for j in range(0b1 << h): -            G_sub = copy.deepcopy(G) -            s = i -            k = 0 -            while s > 0: -                r = s % 2 -                s = s // 2 -                if r == 1: -                    for y in range(h): -                        G_sub[y][k] = "%" -                k += 1 -            s = j -            k = 0 -            while s > 0: -                r = s % 2 -                s = s // 2 -                if r == 1: -                    for x in range(w): -                        G_sub[k][x] = "%" -                k += 1 +    for ib in range(1 << h): +        for jb in range(1 << w): -            for g in G_sub: -                ct += g.count("#") -            if ct == poi: +            for i in range(h): +                for j in range(w): +                    if (ib >> i) & 1 and (jb >> j) & 1 and G[i][j] == "#": +                        ct += 1 +            if ct == k: -main() +main2()