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

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



ans = 0

for i in range(2 ** h):

    for j in range(2 ** w):

        d = [c[x][:] for x in range(h)]

        for p in range(h):

            if (1 << p) & i: 

                for q in range(w): d[p][q] = '.'

        for q in range(w):

            if (1 << q) & j: 

                for p in range(h): d[p][q] = '.'

        cnt = 0

        for p in range(h):

            for q in range(w): cnt += (d[p][q] == '#')

        ans += (cnt == k)

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

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

ans = 0



for i in range(2 ** h): # 行の塗り方パターン

   for j in range(2 ** w): # 列の塗り方のパターン



      d = [c[x][:] for x in range(h)]



      for p in range(h):

         bit = (1 << p)

         if i & bit > 0: 

            for x in range(w): d[p][x] = '*'



      for q in range(w):

         bit = (1 << q)

         if j & bit > 0: 

            for x in range(h): d[x][q] = '*'



      s = 0

      for p in range(h):

         for q in range(w): 

            if d[p][q] == '#': s += 1



      if s == k: ans += 1



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

h, w, k = list(map(int, input().split()))
c = [list(eval(input())) for _ in range(h)]
ans = 0
for i in range(2**h):  # 行の塗り方パターン
    for j in range(2**w):  # 列の塗り方のパターン
        d = [c[x][:] for x in range(h)]
        for p in range(h):
            bit = 1 << p
            if i & bit > 0:
                for x in range(w):
                    d[p][x] = "*"
        for q in range(w):
            bit = 1 << q
            if j & bit > 0:
                for x in range(h):
                    d[x][q] = "*"
        s = 0
        for p in range(h):
            for q in range(w):
                if d[p][q] == "#":
                    s += 1
        if s == k:
            ans += 1
print(ans)

-for i in range(2**h): -    for j in range(2**w): +for i in range(2**h):  # 行の塗り方パターン +    for j in range(2**w):  # 列の塗り方のパターン -            if (1 << p) & i: -                for q in range(w): -                    d[p][q] = "." +            bit = 1 << p +            if i & bit > 0: +                for x in range(w): +                    d[p][x] = "*" -            if (1 << q) & j: -                for p in range(h): -                    d[p][q] = "." -        cnt = 0 +            bit = 1 << q +            if j & bit > 0: +                for x in range(h): +                    d[x][q] = "*" +        s = 0 -                cnt += d[p][q] == "#" -        ans += cnt == k +                if d[p][q] == "#": +                    s += 1 +        if s == k: +            ans += 1