H,W,K = gets.split.map(&:to_i)
C = $<.read.tr("#.\n",'10_').to_i(2)

h,h0,w,w0 = [],(1<<W)-1,[],0
H.times{
	h << h0
	h0 <<= W
	w0 = (w0<<W)|1
}
W.times{
	w << w0
	w0 <<= 1
}

p (2**(H+W)).times.count{|hw|
	c = C
	h.each{|h|
		c &= ~h if hw&1==1
		hw >>= 1
	}
	w.each{|w|
		c &= ~w if hw&1==1
		hw >>= 1
	}
	next c.to_s(2).count(?1) == K
}
