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

raw = []

for _ in range(h):

  tmp = eval(input())

  add = []

  for j in range(w):

    if tmp[j] == '.':

      add.append(0)

    else:

      add.append(1)

  raw.append(add)

ans = 0

time1 = [0 for i in range(h)]

time2 = [0 for j in range(w)]

def nex(time):

  l = len(time)

  for i in range(l):

    if time[i] == 0:

      time[i] = 1

      return time

    else:

      time[i] = 0

  else:

    return 'over'

from copy import deepcopy as dc

while time1 != 'over':

  use = dc(raw)

  for i in range(h):

    if time1[i] == 1:

      for j in range(w):

        use[i][j] = 0

  while time2 != 'over':

    now = dc(use)

    for j in range(w):

      if time2[j] == 1:

        for i in range(h):

          now[i][j] = 0

    cnt = 0

    for i in range(h):

      cnt += sum(now[i])

    #print(time1,time2,cnt)

    if cnt == k:

      ans += 1

    time2 = nex(time2)

  time1 = nex(time1)

  time2 = [0 for _ in range(w)]

print(ans)

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

time1 = [0 for _ in range(h)]

time2 = [0 for _ in range(w)]

raw = []

for _ in range(h):

  raw.append(eval(input()))

def nex(time):

  l = len(time)

  for i in range(l):

    if time[i] == 0:

      time[i] = 1

      return time

    else:

      time[i] = 0

  else:

    return 'over'

ans = 0

while time1 != 'over':

  while time2 != 'over':

    cnt = 0

    for i in range(h):

      for j in range(w):

        if raw[i][j] == '#' and time1[i] == 0 and time2[j] == 0:

          cnt += 1

    if cnt == k:

      ans += 1

    time2 = nex(time2)

  time1 = nex(time1)

  time2 = [0 for _ in range(w)]

print(ans)
h, w, k = list(map(int, input().split()))
raw = []
for _ in range(h):
    tmp = eval(input())
    add = []
    for j in range(w):
        if tmp[j] == ".":
            add.append(0)
        else:
            add.append(1)
    raw.append(add)
ans = 0
time1 = [0 for i in range(h)]
time2 = [0 for j in range(w)]


def nex(time):
    l = len(time)
    for i in range(l):
        if time[i] == 0:
            time[i] = 1
            return time
        else:
            time[i] = 0
    else:
        return "over"


from copy import deepcopy as dc

while time1 != "over":
    use = dc(raw)
    for i in range(h):
        if time1[i] == 1:
            for j in range(w):
                use[i][j] = 0
    while time2 != "over":
        now = dc(use)
        for j in range(w):
            if time2[j] == 1:
                for i in range(h):
                    now[i][j] = 0
        cnt = 0
        for i in range(h):
            cnt += sum(now[i])
        # print(time1,time2,cnt)
        if cnt == k:
            ans += 1
        time2 = nex(time2)
    time1 = nex(time1)
    time2 = [0 for _ in range(w)]
print(ans)
# print(raw)

h, w, k = list(map(int, input().split()))
time1 = [0 for _ in range(h)]
time2 = [0 for _ in range(w)]
raw = []
for _ in range(h):
    raw.append(eval(input()))


def nex(time):
    l = len(time)
    for i in range(l):
        if time[i] == 0:
            time[i] = 1
            return time
        else:
            time[i] = 0
    else:
        return "over"


ans = 0
while time1 != "over":
    while time2 != "over":
        cnt = 0
        for i in range(h):
            for j in range(w):
                if raw[i][j] == "#" and time1[i] == 0 and time2[j] == 0:
                    cnt += 1
        if cnt == k:
            ans += 1
        time2 = nex(time2)
    time1 = nex(time1)
    time2 = [0 for _ in range(w)]
print(ans)

+time1 = [0 for _ in range(h)] +time2 = [0 for _ in range(w)] -    tmp = eval(input()) -    add = [] -    for j in range(w): -        if tmp[j] == ".": -            add.append(0) -        else: -            add.append(1) -    raw.append(add) -ans = 0 -time1 = [0 for i in range(h)] -time2 = [0 for j in range(w)] +    raw.append(eval(input())) -from copy import deepcopy as dc - +ans = 0 -    use = dc(raw) -    for i in range(h): -        if time1[i] == 1: -            for j in range(w): -                use[i][j] = 0 -        now = dc(use) -        for j in range(w): -            if time2[j] == 1: -                for i in range(h): -                    now[i][j] = 0 -            cnt += sum(now[i]) -        # print(time1,time2,cnt) +            for j in range(w): +                if raw[i][j] == "#" and time1[i] == 0 and time2[j] == 0: +                    cnt += 1 -# print(raw)