H,W,K = map(int,input().split())
listA = []
for o in range(0,H):
        listA.append(list(input()))
answer = 0
for a in range(0,2):
    for b in range(0,2):
        for c in range(0,2):
            for d in range(0,2):
                for e in range(0,2):
                    for f in range(0,2):
                        for g in range(0,2):
                            for h in range(0,2):
                                for i in range(0,2):
                                    for j in range(0,2):
                                        for k in range(0,2):
                                            for l in range(0,2):
                                                for m in range(0,1):
                                                    for n in range(0,1):
                                                        count = 0
                                                        try:
                                                            if a == 0 and g == 0 and listA[0][0] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if a == 0 and h == 0 and listA[0][1] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if a == 0 and i == 0 and listA[0][2] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if a == 0 and j == 0 and listA[0][3] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if a == 0 and k == 0 and listA[0][4] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if a == 0 and l == 0 and listA[0][5] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if b == 0 and g == 0 and listA[1][0] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if b == 0 and h == 0 and listA[1][1] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if b == 0 and i == 0 and listA[1][2] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if b == 0 and j == 0 and listA[1][3] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if b == 0 and k == 0 and listA[1][4] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if b == 0 and l == 0 and listA[1][5] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if c == 0 and g == 0 and listA[2][0] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if c == 0 and h == 0 and listA[2][1] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if c == 0 and i == 0 and listA[2][2] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if c == 0 and j == 0 and listA[2][3] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if c == 0 and k == 0 and listA[2][4] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if c == 0 and l == 0 and listA[2][5] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if d == 0 and g == 0 and listA[3][0] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if d == 0 and h == 0 and listA[3][1] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if d == 0 and i == 0 and listA[3][2] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if d == 0 and j == 0 and listA[3][3] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if d == 0 and k == 0 and listA[3][4] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if d == 0 and l == 0 and listA[3][5] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if e == 0 and g == 0 and listA[4][0] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if e == 0 and h == 0 and listA[4][1] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if e == 0 and i == 0 and listA[4][2] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if e == 0 and j == 0 and listA[4][3] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if e == 0 and k == 0 and listA[4][4] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if e == 0 and l == 0 and listA[4][5] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if f == 0 and g == 0 and listA[5][0] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if f == 0 and h == 0 and listA[5][1] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if f == 0 and i == 0 and listA[5][2] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if f == 0 and j == 0 and listA[5][3] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if f == 0 and k == 0 and listA[5][4] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        try:
                                                            if f == 0 and l == 0 and listA[5][5] == '#':
                                                                count = count + 1
                                                        except:
                                                            count = count
                                                        if count == K:
                                                            answer = answer + 1
place = 0.25
for i in range(0,7 - H):
    place = place * 2
for i in range(0,7 - W):
    place = place * 2
print(int(answer / place))

Measured memory_bytes: 9484