#!/usr/bin/env python

# coding: utf-8



def ri():

    return int(eval(input()))



def rl():

    return list(input().split())



def rli():

    return list(map(int, input().split()))



def simulate(mh, mw, H, W, K, grid):

    flags = [[1 for _ in range(W)] for _ in range(H)]

    for h in range(H):

        if not (mh>>h)&1:

            continue

        for w in range(W):

            flags[h][w] = 0

    for w in range(W):

        if not (mw>>w)&1:

            continue

        for h in range(H):

            flags[h][w] = 0

    cnt = 0

    for h in range(H):

        for w in range(W):

            if flags[h][w] and grid[h][w] == '#':

                cnt += 1

    if cnt == K:

        # print(flags)

        # print(mh, mw)

        return 1

    return 0



def main():

    H, W, K = rli()

    grid = []

    for i in range(H):

        grid.append(eval(input()))

    ans = 0

    for mh in range(0, 2**H):

        for mw in range(0, 2**W):

            ans += simulate(mh, mw, H, W, K, grid)

    print(ans)







if __name__ == '__main__':

    main()

#!/usr/bin/env python

# coding: utf-8



def ri():

    return int(eval(input()))



def rl():

    return list(input().split())



def rli():

    return list(map(int, input().split()))



def main():

    H, W, K = rli()

    grid = []

    for i in range(H):

        grid.append(eval(input()))

    ans = 0

    for mh in range(0, 2**H):

        for mw in range(0, 2**W):

            cnt = 0

            for h in range(H):

                for w in range(W):

                    if grid[h][w] == '#' and ((mh>>h)&1) and ((mw>>w)&1):

                        cnt += 1

            if cnt == K:

                ans += 1

    print(ans)







if __name__ == '__main__':

    main()

#!/usr/bin/env python
# coding: utf-8
def ri():
    return int(eval(input()))


def rl():
    return list(input().split())


def rli():
    return list(map(int, input().split()))


def simulate(mh, mw, H, W, K, grid):
    flags = [[1 for _ in range(W)] for _ in range(H)]
    for h in range(H):
        if not (mh >> h) & 1:
            continue
        for w in range(W):
            flags[h][w] = 0
    for w in range(W):
        if not (mw >> w) & 1:
            continue
        for h in range(H):
            flags[h][w] = 0
    cnt = 0
    for h in range(H):
        for w in range(W):
            if flags[h][w] and grid[h][w] == "#":
                cnt += 1
    if cnt == K:
        # print(flags)
        # print(mh, mw)
        return 1
    return 0


def main():
    H, W, K = rli()
    grid = []
    for i in range(H):
        grid.append(eval(input()))
    ans = 0
    for mh in range(0, 2**H):
        for mw in range(0, 2**W):
            ans += simulate(mh, mw, H, W, K, grid)
    print(ans)


if __name__ == "__main__":
    main()

#!/usr/bin/env python
# coding: utf-8
def ri():
    return int(eval(input()))


def rl():
    return list(input().split())


def rli():
    return list(map(int, input().split()))


def main():
    H, W, K = rli()
    grid = []
    for i in range(H):
        grid.append(eval(input()))
    ans = 0
    for mh in range(0, 2**H):
        for mw in range(0, 2**W):
            cnt = 0
            for h in range(H):
                for w in range(W):
                    if grid[h][w] == "#" and ((mh >> h) & 1) and ((mw >> w) & 1):
                        cnt += 1
            if cnt == K:
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-def simulate(mh, mw, H, W, K, grid): -    flags = [[1 for _ in range(W)] for _ in range(H)] -    for h in range(H): -        if not (mh >> h) & 1: -            continue -        for w in range(W): -            flags[h][w] = 0 -    for w in range(W): -        if not (mw >> w) & 1: -            continue -        for h in range(H): -            flags[h][w] = 0 -    cnt = 0 -    for h in range(H): -        for w in range(W): -            if flags[h][w] and grid[h][w] == "#": -                cnt += 1 -    if cnt == K: -        # print(flags) -        # print(mh, mw) -        return 1 -    return 0 - - -            ans += simulate(mh, mw, H, W, K, grid) +            cnt = 0 +            for h in range(H): +                for w in range(W): +                    if grid[h][w] == "#" and ((mh >> h) & 1) and ((mw >> w) & 1): +                        cnt += 1 +            if cnt == K: +                ans += 1