ita=(0 0_1 00_01_10_11 000_001_010_011_100_101_110_111 0000_0001_0010_0011_0100_0101_0110_0111_1000_1001_1010_1011_1100_1101_1110_1111 00000_00001_00010_00011_00100_00101_00110_00111_01000_01001_01010_01011_01100_01101_01110_01111_10000_10001_10010_10011_10100_10101_10110_10111_11000_11001_11010_11011_11100_11101_11110_11111 000000_000001_000010_000011_000100_000101_000110_000111_001000_001001_001010_001011_001100_001101_001110_001111_010000_010001_010010_010011_010100_010101_010110_010111_011000_011001_011010_011011_011100_011101_011110_011111_100000_100001_100010_100011_100100_100101_100110_100111_101000_101001_101010_101011_101100_101101_101110_101111_110000_110001_110010_110011_110100_110101_110110_110111_111000_111001_111010_111011_111100_111101_111110_111111)
read h w k
c=(`tr 0 0`)
s=0
v=0
ia=(`echo ${ita[h]} | tr '_' ' '`)
ja=(`echo ${ita[w]} | tr '_' ' '`)
if((k==0))
then
    s=$((2**h+2**w))
fi
ia[0]=""
ja[0]=""
for ic in ${ia[@]}
do
    for jc in ${ja[@]}
    do
        #echo "check $ic,$jc"
        s=0
        for i in `seq 0 $((h-1))`
        do
            icc=${ic:i:1}
            for j in `seq 0 $((w-1))`
            do
                if((icc&&${jc:j:1})) && [ ${c[i]:j:1} = '#' ]
                then
                    s=$((s+1))
                fi
            done
        done
        if((s==k))
        then
            v=$((v+1))
        fi
    done
done
echo $v