
TABLE_BITS_COUNT = [
  0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4,
  1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
  1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
  2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6
]
TABLE_TRAILING_ZERO = [ 0, 1, 6, 2, 7, 5, 4, 3 ]

def fold_bitflag(n, init)
  loop {
    flg = n & ((~n) + 1)
    if flg == 0
      break init
    end
    init = yield(init, flg)
    n ^= flg
  }
end

H, W, K = ARGF.gets.split.map(&:to_i)

ary = H.times.map {
  ARGF.gets.tr(".#", "01").to_i(2)
}

ans = 0
(0..(1 << H) - 1).each {| row |
  (0..(1 << W) - 1).each {| col |
    cnt = fold_bitflag(row, 0) {| acc, x |
      i = TABLE_TRAILING_ZERO[((x * 0x1d) >> 5) & 0x07]
      acc + TABLE_BITS_COUNT[ary[i] & col]
    }
    if cnt == K
      ans += 1
    end
  }
}
puts ans
