import copy

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

c = [list(eval(input())) for i in range(h)]

ans = 0



for i in range(2**h):

    for j in range(2**w):

        d = copy.deepcopy(c)

        for k in range(h):

            if i%(2**(k+1))//(2**k)==1:

                for j2 in range(w):

                    d[k][j2]='r'

        for l in range(w):

            if j%(2**(l+1))//(2**l)==1:

                for i2 in range(h):

                    d[i2][l]='r'

        black = 0

        for i3 in range(h):

            for j3 in range(w):

                if d[i3][j3]=='#':

                    black +=1

        if black == k2:

            ans+=1

print(ans)

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

c = [list(eval(input())) for i in range(h)]

ans = 0

for i in range(2**h):

    for j in range(2**w):

        black = 0

        for i2 in range(h):

            for j2 in range(w):

                if c[i2][j2]=='#' and i>>i2&1==0 and j>>j2&1==0:

                    black +=1

        if black == k:

            ans+=1

print(ans)

import copy

h, w, k2 = list(map(int, input().split()))
c = [list(eval(input())) for i in range(h)]
ans = 0
for i in range(2**h):
    for j in range(2**w):
        d = copy.deepcopy(c)
        for k in range(h):
            if i % (2 ** (k + 1)) // (2**k) == 1:
                for j2 in range(w):
                    d[k][j2] = "r"
        for l in range(w):
            if j % (2 ** (l + 1)) // (2**l) == 1:
                for i2 in range(h):
                    d[i2][l] = "r"
        black = 0
        for i3 in range(h):
            for j3 in range(w):
                if d[i3][j3] == "#":
                    black += 1
        if black == k2:
            ans += 1
print(ans)

h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for i in range(h)]
ans = 0
for i in range(2**h):
    for j in range(2**w):
        black = 0
        for i2 in range(h):
            for j2 in range(w):
                if c[i2][j2] == "#" and i >> i2 & 1 == 0 and j >> j2 & 1 == 0:
                    black += 1
        if black == k:
            ans += 1
print(ans)

-import copy - -h, w, k2 = list(map(int, input().split())) +h, w, k = list(map(int, input().split())) -        d = copy.deepcopy(c) -        for k in range(h): -            if i % (2 ** (k + 1)) // (2**k) == 1: -                for j2 in range(w): -                    d[k][j2] = "r" -        for l in range(w): -            if j % (2 ** (l + 1)) // (2**l) == 1: -                for i2 in range(h): -                    d[i2][l] = "r" -        for i3 in range(h): -            for j3 in range(w): -                if d[i3][j3] == "#": +        for i2 in range(h): +            for j2 in range(w): +                if c[i2][j2] == "#" and i >> i2 & 1 == 0 and j >> j2 & 1 == 0: -        if black == k2: +        if black == k: