h,*c=open(0)

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

print((sum(k==sum(y//2**w>>z//w&y%2**w>>z%w&1and'.'>c[z//w][z%w]for z in range(h*w))for y in range(1<<h+w))))
h,*c=open(0)

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

print((sum(k==sum(y>>w>>z//w&y%2**w>>z%w&1and'.'>c[z//w][z%w]for z in range(h*w))for y in range(1<<h+w))))
h, *c = open(0)
h, w, k = list(map(int, h.split()))
print(
    (
        sum(
            k
            == sum(
                y // 2**w >> z // w & y % 2**w >> z % w & 1
                and "." > c[z // w][z % w]
                for z in range(h * w)
            )
            for y in range(1 << h + w)
        )
    )
)

h, *c = open(0)
h, w, k = list(map(int, h.split()))
print(
    (
        sum(
            k
            == sum(
                y >> w >> z // w & y % 2**w >> z % w & 1 and "." > c[z // w][z % w]
                for z in range(h * w)
            )
            for y in range(1 << h + w)
        )
    )
)

-                y // 2**w >> z // w & y % 2**w >> z % w & 1 -                and "." > c[z // w][z % w] +                y >> w >> z // w & y % 2**w >> z % w & 1 and "." > c[z // w][z % w]