#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn convert_to_bitstring(n: u32, keta: usize) -> Vec<usize> {
    let mut svec: Vec<u32> = Vec::new();
    let mut val = n;
    let base: u32 = 2;
    for i in (0..keta).rev() {
        svec.push(val / base.pow(i as u32));
        // println!("{}, {}, {}", val, base.pow(i), val / base.pow(i));
        val = val % base.pow(i as u32);
    }
    let mut vals: Vec<usize> = Vec::new();
    for (i, val) in svec.into_iter().rev().enumerate() {
        if val == 1 {
            vals.push(i);
        }
    }
    vals
}

fn main() {
    input! {
        h: usize,
        w: usize,
        k: usize,
        board: [chars; h],
    };

    // それぞれの行・列でどれだけ黒いますがあるのか計算しておく
    let mut blacks_h: Vec<usize> = Vec::new(); // 行ごとの黒の数
    for i in 0..h {
        let mut black = 0;
        let cc = board.get(i).expect("");
        for c in cc {
            if c == &'#' {
                black += 1;
            }
        }
        blacks_h.push(black);
    }
    // println!("blacks_h: {:?}", blacks_h);
    let mut blacks_w: Vec<usize> = Vec::new(); // 列ごとの黒の数
    for i in 0..w {
        let mut black = 0;
        for gyou in board.clone() {
            if gyou.get(i).unwrap() == &'#' {
                black += 1;
            }
        }
        blacks_w.push(black);
    }
    // println!("blacks_w: {:?}", blacks_w);

    let mut black_sum = 0; // 全体での黒の数
    for val in blacks_w.clone() {
        black_sum += val;
    }
    // println!("black_sum: {:?}", black_sum);

    // どの行・列を赤く塗るか全通りを考える
    let mut ans = 0;
    let base: u32 = 2;
    for i in 0..(base.pow(w as u32)) {
        let base: u32 = 2;
        for j in 0..(base.pow(h as u32)) {
            // 今回赤く塗る行・列
            let w_bitset = convert_to_bitstring(i, w);
            let h_bitset = convert_to_bitstring(j, h);
            let mut black_w = 0;
            let mut black_h = 0;
            let mut black_wh = 0;

            for i in w_bitset.clone() {
                black_w += blacks_w.get(i).expect("");
            }
            for j in h_bitset.clone() {
                black_h += blacks_h.get(j).expect("");
            }
            for i in w_bitset.clone() {
                for j in h_bitset.clone() {
                    if board[j][i] == '#' {
                        black_wh += 1;
                    }
                }
            }
            let black = black_sum + black_wh - black_w - black_h;
            if black == k {
                ans += 1;
            }
            /*
            println!(
                "w: {:?}, h: {:?}, black_w: {}, black_h: {}, black_wh: {} => {}",
                w_bitset, h_bitset, black_w, black_h, black_wh, black
            );
            */
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 2156