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

c = []

for _ in range(h):

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

ans = 0

for x in range(2**(h+w)):

    cnt = 0

    for i in range(h):

        for j in range(w):

            if x>>i&1 or x>>(h+j)&1 or c[i][j]=='.':

                continue

            cnt += 1

    if cnt==k:

        ans += 1

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

c = []

for _ in range(h):

    c.append(eval(input()))

ans = 0

for i in range(2**h):

    for j in range(2**w):

        tmp = 0

        for y in range(h):

            for x in range(w):

                if i>>y&1 or j>>x&1 or c[y][x]=='.':

                    continue

                tmp += 1

        if tmp==k:

            ans += 1

print(ans)
h, w, k = list(map(int, input().split()))
c = []
for _ in range(h):
    c.append(list(eval(input())))
ans = 0
for x in range(2 ** (h + w)):
    cnt = 0
    for i in range(h):
        for j in range(w):
            if x >> i & 1 or x >> (h + j) & 1 or c[i][j] == ".":
                continue
            cnt += 1
    if cnt == k:
        ans += 1
print(ans)

h, w, k = list(map(int, input().split()))
c = []
for _ in range(h):
    c.append(eval(input()))
ans = 0
for i in range(2**h):
    for j in range(2**w):
        tmp = 0
        for y in range(h):
            for x in range(w):
                if i >> y & 1 or j >> x & 1 or c[y][x] == ".":
                    continue
                tmp += 1
        if tmp == k:
            ans += 1
print(ans)

-    c.append(list(eval(input()))) +    c.append(eval(input())) -for x in range(2 ** (h + w)): -    cnt = 0 -    for i in range(h): -        for j in range(w): -            if x >> i & 1 or x >> (h + j) & 1 or c[i][j] == ".": -                continue -            cnt += 1 -    if cnt == k: -        ans += 1 +for i in range(2**h): +    for j in range(2**w): +        tmp = 0 +        for y in range(h): +            for x in range(w): +                if i >> y & 1 or j >> x & 1 or c[y][x] == ".": +                    continue +                tmp += 1 +        if tmp == k: +            ans += 1