import sys



readline = sys.stdin.readline

MOD = 10 ** 9 + 7

INF = float('INF')

sys.setrecursionlimit(10 ** 5)





def main():

    from itertools import product



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

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



    ans = 0



    for row_bit in product(list(range(2)), repeat=h):

        for col_bit in product(list(range(2)), repeat=w):

            cnt = 0

            for row in range(h):

                for col in range(w):

                    if c[row][col] == "#" and (row_bit[row] and col_bit[col]):

                        cnt += 1

            if cnt == k:

                ans += 1



    print(ans)





if __name__ == '__main__':

    main()

from itertools import product



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

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



ans = 0



for row_bit in product(list(range(2)), repeat=h):

    for col_bit in product(list(range(2)), repeat=w):

        cnt = 0

        for row in range(h):

            for col in range(w):

                if c[row][col] == "#" and (row_bit[row] and col_bit[col]):

                    cnt += 1

        if cnt == k:

            ans += 1



print(ans)
import sys

readline = sys.stdin.readline
MOD = 10**9 + 7
INF = float("INF")
sys.setrecursionlimit(10**5)


def main():
    from itertools import product

    h, w, k = list(map(int, readline().split()))
    c = [list(eval(input())) for _ in range(h)]
    ans = 0
    for row_bit in product(list(range(2)), repeat=h):
        for col_bit in product(list(range(2)), repeat=w):
            cnt = 0
            for row in range(h):
                for col in range(w):
                    if c[row][col] == "#" and (row_bit[row] and col_bit[col]):
                        cnt += 1
            if cnt == k:
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()

from itertools import product

h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for _ in range(h)]
ans = 0
for row_bit in product(list(range(2)), repeat=h):
    for col_bit in product(list(range(2)), repeat=w):
        cnt = 0
        for row in range(h):
            for col in range(w):
                if c[row][col] == "#" and (row_bit[row] and col_bit[col]):
                    cnt += 1
        if cnt == k:
            ans += 1
print(ans)

-import sys +from itertools import product -readline = sys.stdin.readline -MOD = 10**9 + 7 -INF = float("INF") -sys.setrecursionlimit(10**5) - - -def main(): -    from itertools import product - -    h, w, k = list(map(int, readline().split())) -    c = [list(eval(input())) for _ in range(h)] -    ans = 0 -    for row_bit in product(list(range(2)), repeat=h): -        for col_bit in product(list(range(2)), repeat=w): -            cnt = 0 -            for row in range(h): -                for col in range(w): -                    if c[row][col] == "#" and (row_bit[row] and col_bit[col]): -                        cnt += 1 -            if cnt == k: -                ans += 1 -    print(ans) - - -if __name__ == "__main__": -    main() +h, w, k = list(map(int, input().split())) +c = [list(eval(input())) for _ in range(h)] +ans = 0 +for row_bit in product(list(range(2)), repeat=h): +    for col_bit in product(list(range(2)), repeat=w): +        cnt = 0 +        for row in range(h): +            for col in range(w): +                if c[row][col] == "#" and (row_bit[row] and col_bit[col]): +                    cnt += 1 +        if cnt == k: +            ans += 1 +print(ans)