import copy





def main():

    height, width, leave_black = [int(x) for x in input().split()]

    table = [list(eval(input())) for _ in range(height)]

    ans = 0

    for num_h in range(2 ** height):

        for num_w in range(2 ** width):

            tmp = copy.deepcopy(table)

            for bit_h in range(height):

                if num_h >> bit_h & 1:

                    tmp[bit_h] = ['r'] * width

            for bit_w in range(width):

                if num_w >> bit_w & 1:

                    for row in tmp:

                        row[bit_w] = 'r'

            # print(num_h, num_w, tmp)

            if sum(c == '#' for row in tmp for c in row) == leave_black:

                ans += 1

    print(ans)





if __name__ == '__main__':

    main()



def main():

    height, width, leave_black = [int(x) for x in input().split()]

    table = [eval(input()) for _ in range(height)]



    ans = 0

    for num_h in range(2 ** height):

        for num_w in range(2 ** width):

            black_count = 0

            for bit_h in range(height):

                for bit_w in range(width):

                    if num_h >> bit_h & 1 or num_w >> bit_w & 1:

                        continue

                    black_count += table[bit_h][bit_w] == '#'

            ans += black_count == leave_black



    print(ans)





if __name__ == '__main__':

    main()

import copy


def main():
    height, width, leave_black = [int(x) for x in input().split()]
    table = [list(eval(input())) for _ in range(height)]
    ans = 0
    for num_h in range(2**height):
        for num_w in range(2**width):
            tmp = copy.deepcopy(table)
            for bit_h in range(height):
                if num_h >> bit_h & 1:
                    tmp[bit_h] = ["r"] * width
            for bit_w in range(width):
                if num_w >> bit_w & 1:
                    for row in tmp:
                        row[bit_w] = "r"
            # print(num_h, num_w, tmp)
            if sum(c == "#" for row in tmp for c in row) == leave_black:
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()

def main():
    height, width, leave_black = [int(x) for x in input().split()]
    table = [eval(input()) for _ in range(height)]
    ans = 0
    for num_h in range(2**height):
        for num_w in range(2**width):
            black_count = 0
            for bit_h in range(height):
                for bit_w in range(width):
                    if num_h >> bit_h & 1 or num_w >> bit_w & 1:
                        continue
                    black_count += table[bit_h][bit_w] == "#"
            ans += black_count == leave_black
    print(ans)


if __name__ == "__main__":
    main()

-import copy - - -    table = [list(eval(input())) for _ in range(height)] +    table = [eval(input()) for _ in range(height)] -            tmp = copy.deepcopy(table) +            black_count = 0 -                if num_h >> bit_h & 1: -                    tmp[bit_h] = ["r"] * width -            for bit_w in range(width): -                if num_w >> bit_w & 1: -                    for row in tmp: -                        row[bit_w] = "r" -            # print(num_h, num_w, tmp) -            if sum(c == "#" for row in tmp for c in row) == leave_black: -                ans += 1 +                for bit_w in range(width): +                    if num_h >> bit_h & 1 or num_w >> bit_w & 1: +                        continue +                    black_count += table[bit_h][bit_w] == "#" +            ans += black_count == leave_black