Buggy python submission (verdict: Runtime Error):
# def c():
#     n = int(input())
#     inp = {}
#     for i in range(n):
#         a = input()
#         if inp.get(a) is None:
#             inp[a] = 0
#         inp[a] += 1
#     print(f"AC x {0 if inp.get('AC') is None else inp.get('AC')}")
#     print(f"WA x {0 if inp.get('WA') is None else inp.get('WA')}")
#     print(f"TLE x {0 if inp.get('TLE') is None else inp.get('TLE')}")
#     print(f"RE x {0 if inp.get('RE') is None else inp.get('RE')}")

# c()


h, w, k = [int(x) for x in input.split()]
ans = 0

grid = []

for i in range(h):
    grid.append(input.split())

black = 0

for maskRow in range(0, 1 << h):
    for maskCol in range(0, 1 << w):
        black = 0
        for i in range(h):
            for j in range(w):
                if (maskRow >> i) & 1 == 0 and (maskCol >> j) & 1 == 0 \
                                                    and grid[i][j] == '#':
                    black += 1
    if black == k:
        ans += 1

print(ans)


Fixed submission:
# def c():
#     n = int(input())
#     inp = {}
#     for i in range(n):
#         a = input()
#         if inp.get(a) is None:
#             inp[a] = 0
#         inp[a] += 1
#     print(f"AC x {0 if inp.get('AC') is None else inp.get('AC')}")
#     print(f"WA x {0 if inp.get('WA') is None else inp.get('WA')}")
#     print(f"TLE x {0 if inp.get('TLE') is None else inp.get('TLE')}")
#     print(f"RE x {0 if inp.get('RE') is None else inp.get('RE')}")

# c()


h, w, k = [int(x) for x in input().split()]
ans = 0

grid = []

for i in range(h):
    grid.append(list(input()))

black = 0

for maskRow in range(0, 1 << h):
    for maskCol in range(0, 1 << w):
        black = 0
        for i in range(h):
            for j in range(w):
                if (maskRow >> i) & 1 == 0 and (maskCol >> j) & 1 == 0 \
                                                    and grid[i][j] == '#':
                    black += 1
        if black == k:
            ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
h, w, k = [int(x) for x in input.split()]
ans = 0

grid = []

for i in range(h):
	grid.append(input.split())

black = 0

for maskRow in range(0, 1 << h):
	for maskCol in range(0, 1 << w):
      black = 0
      for i in range(h):
        for j in range(w):
          if (maskRow >> i) & 1 == 0 and (maskCol >> j) & 1 == 0 \
                                                    and grid[i][j] == '#':
              black += 1
      if black == k:
        ans += 1

print(ans)


Fixed submission:
# def c():
#     n = int(input())
#     inp = {}
#     for i in range(n):
#         a = input()
#         if inp.get(a) is None:
#             inp[a] = 0
#         inp[a] += 1
#     print(f"AC x {0 if inp.get('AC') is None else inp.get('AC')}")
#     print(f"WA x {0 if inp.get('WA') is None else inp.get('WA')}")
#     print(f"TLE x {0 if inp.get('TLE') is None else inp.get('TLE')}")
#     print(f"RE x {0 if inp.get('RE') is None else inp.get('RE')}")

# c()


h, w, k = [int(x) for x in input().split()]
ans = 0

grid = []

for i in range(h):
    grid.append(list(input()))

black = 0

for maskRow in range(0, 1 << h):
    for maskCol in range(0, 1 << w):
        black = 0
        for i in range(h):
            for j in range(w):
                if (maskRow >> i) & 1 == 0 and (maskCol >> j) & 1 == 0 \
                                                    and grid[i][j] == '#':
                    black += 1
        if black == k:
            ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
h, w, k = [int(x) for x in input.split()]
ans = 0

grid = []

for i in range(h):
    grid.append(input.split())

black = 0

for maskRow in range(0, 1 << h):
    for maskCol in range(0, 1 << w):
        black = 0
        for i in range(h):
            for j in range(w):
                if (maskRow >> i) & 1 == 0 and (maskCol >> j) & 1 == 0 \
                                                    and grid[i][j] == '#':
                    black += 1
    if black == k:
        ans += 1

print(ans)

Fixed submission:
# def c():
#     n = int(input())
#     inp = {}
#     for i in range(n):
#         a = input()
#         if inp.get(a) is None:
#             inp[a] = 0
#         inp[a] += 1
#     print(f"AC x {0 if inp.get('AC') is None else inp.get('AC')}")
#     print(f"WA x {0 if inp.get('WA') is None else inp.get('WA')}")
#     print(f"TLE x {0 if inp.get('TLE') is None else inp.get('TLE')}")
#     print(f"RE x {0 if inp.get('RE') is None else inp.get('RE')}")

# c()


h, w, k = [int(x) for x in input().split()]
ans = 0

grid = []

for i in range(h):
    grid.append(list(input()))

black = 0

for maskRow in range(0, 1 << h):
    for maskCol in range(0, 1 << w):
        black = 0
        for i in range(h):
            for j in range(w):
                if (maskRow >> i) & 1 == 0 and (maskCol >> j) & 1 == 0 \
                                                    and grid[i][j] == '#':
                    black += 1
        if black == k:
            ans += 1

print(ans)