@staticmethod
def c():
    (h, w, k) = map(int, sys.stdin.readline().split())
    c = [sys.stdin.readline().rstrip() for _ in range(h)]
    tot = 0
    for i in range((1 << h)):
        for j in range((1 << w)):
            cnt = 0
            for y in range(h):
                for x in range(w):
                    if (((i >> y) & 1) or ((j >> x) & 1)):
                        continue
                    cnt += (c[y][x] == '#')
            tot += (cnt == k)
    print(tot)
@staticmethod
def c():
    (h, w, k) = map(int, sys.stdin.readline().split())
    c = [sys.stdin.readline().rstrip() for _ in range(h)]
    tot = 0
    for i in range((1 << h)):
        for j in range((1 << w)):
            cnt = 0
            for y in range(h):
                for x in range(w):
                    if (((i >> y) & 1) or ((j >> x) & 1)):
                        continue
                    cnt += (c[y][x] == '#')
            tot += (cnt == k)
    print(tot)