jiahuimbzuai/CoQuIR huggingface dataset:
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func max(nums []int) int {
	ret := nums[0]
	for _, v := range nums {
		if v > ret {
			ret = v
		}
	}
	return ret
}

func min(nums []int) int {
	ret := nums[0]
	for _, v := range nums {
		if v < ret {
			ret = v
		}
	}
	return ret
}

func main() {
	sc.Split(bufio.ScanWords)
	n, m, x, y := nextInt(), nextInt(), nextInt(), nextInt()
	maxX := max(nextInts(n))
	minY := min(nextInts(m))
	ok := false
	for z := maxX + 1; z <= minY; z++ {
		if x < z && z <= y {
			ok = true
			break
		}
	}
	if ok {
		puts("No War")
	} else {
		puts("War")
	}
	wt.Flush()
}

var (
	sc  = bufio.NewScanner(os.Stdin)
	rdr = bufio.NewReaderSize(os.Stdin, 1000000)
	wt  = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func nextFloat64s(n int) []float64 {
	slice := make([]float64, n)
	for i := 0; i < n; i++ {
		slice[i] = nextFloat64()
	}
	return slice
}

func nextMega() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, _ := rdr.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func putf(format string, a ...interface{}) {
	fmt.Fprintf(wt, format, a...)
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
	"strings"
)

func main() {
	io, flush := NewIO()
	defer flush()

	n, m, x, y := io.ScanInt4()
	xlist := io.ScanInts(n)
	ylist := io.ScanInts(m)

	sort.Ints(xlist)
	sort.Ints(ylist)

	for i := xlist[len(xlist)-1]; i <= ylist[0]; i++ {
		if x < i && i <= y {
			fmt.Println("No War")
			return
		}
	}
	fmt.Println("War")
}

type IO struct {
	scanner *bufio.Scanner
	writer  *bufio.Writer
}

func NewIO() (*IO, func()) {
	io := &IO{
		scanner: newScanner(),
		writer:  newWriter(),
	}
	return io, func() { io.writer.Flush() }
}

func newScanner() *bufio.Scanner {
	s := bufio.NewScanner(os.Stdin)
	s.Buffer(make([]byte, 10000000), 10000000)
	s.Split(bufio.ScanWords)
	return s
}

func newWriter() *bufio.Writer {
	return bufio.NewWriter(os.Stdout)
}

func (io *IO) ScanBytes() []byte {
	if !io.scanner.Scan() {
		panic("scan string failed")
	}
	return io.scanner.Bytes()
}

func (io *IO) ScanString() string {
	if !io.scanner.Scan() {
		panic("scan string failed")
	}
	return io.scanner.Text()
}

func (io *IO) ScanStrings(n int) []string {
	strs := make([]string, n)
	for i := 0; i < n; i++ {
		strs[i] = io.ScanString()
	}
	return strs
}

func (io *IO) Scan2DStrings(y, x int) [][]string {
	strings := make([][]string, y)
	for i := 0; i < y; i++ {
		strings[i] = io.ScanStrings(x)
	}
	return strings
}

func (io *IO) Scan2DGraph(y int) [][]string {
	strs := make([][]string, y)
	for i := 0; i < y; i++ {
		strs[i] = strings.Split(io.ScanString(), "")
	}
	return strs
}

func (io *IO) ScanInt() int {
	return int(io.ScanInt64())
}

func (io *IO) ScanInt2() (int, int) {
	return int(io.ScanInt64()), int(io.ScanInt64())
}

func (io *IO) ScanInt3() (int, int, int) {
	return int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64())
}

func (io *IO) ScanInt4() (int, int, int, int) {
	return int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64())
}

func (io *IO) ScanInts(n int) []int {
	ints := make([]int, n)
	for i := 0; i < n; i++ {
		ints[i] = io.ScanInt()
	}
	return ints
}

func (io *IO) Scan2DInts(y, x int) [][]int {
	ints := make([][]int, y)
	for i := 0; i < y; i++ {
		ints[i] = io.ScanInts(x)
	}
	return ints
}

func (io *IO) ScanInt64() int64 {
	i, err := strconv.ParseInt(io.ScanString(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *IO) ScanFloat64() float64 {
	i, _ := strconv.ParseFloat(io.ScanString(), 64)
	return i
}

func (io *IO) ScanFloat64s(n int) []float64 {
	floats := make([]float64, n)
	for i := 0; i < n; i++ {
		floats[i] = io.ScanFloat64()
	}
	return floats
}

func (io *IO) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}
//  [go]
package main

import "fmt"

func main(){
	var N,M,X,Y int
	fmt.Scan(&N,&M,&X,&Y)
	x := make([]int,N)
	y := make([]int,M)
	for i:=0;i<N;i++{
		fmt.Scan(&x[i])
	}
	for i:=0;i<M;i++ {
		fmt.Scan(&y[i])
	}
	xmax := x[0]
	ymin := y[0]

	for i:=0;i<N;i++{
		if xmax < x[i]{
			xmax = x[i]
		}

	}

	for i:=0;i<M;i++{
		if ymin > y[i]{
			ymin = y[i]
		}
	}

	if xmax < ymin && X < xmax+1 && xmax+1 <= Y {
		fmt.Println("No War")
	}else {
		fmt.Println("War")
	}
//  [go]
package main

import "fmt"

func main(){
	var N,M,X,Y int
	fmt.Scan(&N,&M,&X,&Y)
	x := make([]int,N)
	y := make([]int,M)
	for i:=0;i<N;i++{
		fmt.Scan(&x[i])
	}
	for i:=0;i<M;i++ {
		fmt.Scan(&y[i])
	}
	xmax := x[0]
	ymin := y[0]

	for i:=0;i<N;i++{
		if xmax < x[i]{
			xmax = x[i]
		}

	}
	xmax++
	for i:=0;i<M;i++{
		if ymin > x[i]{
			ymin = x[i]
		}
	}

	if xmax < ymin && X < Y {
		fmt.Println("No War")
	}else {
		fmt.Println("War")
	}

}
//  [ruby]
_, _, x, y = gets.chomp.split.map(&:to_i)
xc = gets.chomp.split.map(&:to_i)
yc = gets.chomp.split.map(&:to_i)
xc << x
xc.sort!
yc << y
yc.sort!
puts (yc[0] - xc[-1] > 0)? "No War" : "War"
//  [ruby]
n,m,x,y = gets.split.map(&:to_i)
xwant = gets.split.map(&:to_i).sort
ywant = gets.split.map(&:to_i).sort
if xwant[-1] < ywant[0]
  hani = [*((xwant[-1] + 1)..ywant[0])]
  if (hani.size == 1 && x < hani[0] && y >= hani[0]) || hani.size >= 2
    puts "No War"
  else
    puts :War
  end
else
  puts :War
end
//  [ruby]
nmxy = gets.chomp.split
n = nmxy[0].to_i
m = nmxy[1].to_i
X = nmxy[2].to_i
Y = nmxy[3].to_i

x = gets.chomp.split
n.times do |i|
    x[i] = x[i].to_i
end

y = gets.chomp.split
m.times do |i|
    y[i] = y[i].to_i
end

war = true
((X + 1)..Y).each do |z|
    agreement = true
    n.times do |i|
        if x[i] >= z
            agreement = false
            break
        end
    end
    if agreement
        m.times do |i|
            if y[i] < z
                agreement = false
                break
            end
        end
    end
    if agreement
        war = false
        break
    end
end

puts war ? "War" : "No War"
//  [ruby]
n,m,x,y=gets.split.map &:to_i
a=gets.split.map &:to_i
b=gets.split.map &:to_i
ans1= b.min-(a.max+1)>=0? 1:0
ans2= (a.max+1-x>0 && y-a.max+1>=0)? 1:0
puts ans1+ans2>=2 ? "No War" :"War"
//  [ruby]
n,m,x,y=gets.split.map &:to_i
a=gets.split.map &:to_i
b=gets.split.map &:to_i
ans1= b.min-(a.max+1)>=0? 1:0
ans2= (ans1-x>0 && y-ans1>=0)? 1:0
puts ans1+ans2>=2 ? "No War" :"War"
//  [ruby]
n,m,x,y=gets.split.map &:to_i
a=gets.split.map &:to_i
b=gets.split.map &:to_i
ans1= b.min-(a.max+1)>=0? 1:0
ans2= (ans1-x>0 && y-ans1>=0)? 1:0
puts ans1+ans2>=1 ? "No War" :"War"
//  [rust]
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

use std::cmp::max;

fn main() {
    let n: usize = read();
    let m: usize = read();
    let x: i64 = read();
    let y: i64 = read();
    let mut xv: Vec<i64> = vec![x];
    let mut yv: Vec<i64> = vec![y];

    for _ in 0..n {
        xv.push(read());
    }

    for _ in 0..m {
        yv.push(read());
    }

    let maxv = xv.iter().max();
    let minv = yv.iter().min();

    if maxv < minv {
        println!("No War");
    } else {
        println!("War");
    }
}
//  [rust]
use std::io::Read;

fn main() {
    let mut buf = String::new();

    std::io::stdin().read_to_string(&mut buf).unwrap();

    let mut iter = buf.split_whitespace();
    let n: usize = iter.next().unwrap().parse().unwrap();
    let m: usize = iter.next().unwrap().parse().unwrap();
    let x: i32 = iter.next().unwrap().parse().unwrap();
    let y: i32 = iter.next().unwrap().parse().unwrap();
    let xs: Vec<i32> = (0..n).map(|_| iter.next().unwrap().parse().unwrap()).collect();
    let ys: Vec<i32> = (0..m).map(|_| iter.next().unwrap().parse().unwrap()).collect();
    let max_x = *xs.iter().max().unwrap();
    let min_y = *ys.iter().min().unwrap();

    let ans = std::cmp::max(max_x, x) < std::cmp::min(min_y, y);
    println!("{}", if ans { "No War" } else { "War" });

}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input!(n: usize,m:usize,x:isize,y:isize,mut xn:[isize;n],mut ym:[isize;m]);

    xn.sort();
    ym.sort();

    let is_oc = if xn[xn.len() - 1] >= ym[0] {
        true
    } else {
        let count = (xn[xn.len() - 1]..ym[0])
            .filter(|&xxx| x < xxx && xxx <= y)
            .count();
        count == 0
    };

    println!("{}", if is_oc { "War" } else { "No War" });
}
//  [rust]
use std::fmt;


#[derive(Debug)]
enum ANS {
    WAR,
    NOWAR,
}
impl fmt::Display for ANS {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        let text = match self {
            ANS::WAR => "War",
            ANS::NOWAR => "No War",
        };
        write!(f, "{}", text)
    }
}

fn main() {
    let (_n, _m, x, y) = read_tuple::<i32>();
    let x_points = read_vec::<i32>();
    let y_points = read_vec::<i32>();

    let mut ans = ANS::WAR;
    for z in (x+1)..=y {
        if x_points.iter().all(|&x| x < z) && y_points.iter().all(|&y| z <= y) {
            ans = ANS::NOWAR;
            break;
        }
    }
    println!("{}", ans);
}
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}
fn read_tuple<T: std::str::FromStr + Copy>() -> (T, T, T, T) {
    let temp = read_vec();
    (temp[0], temp[1], temp[2], temp[3])
}
//  [swift]
import Foundation
func toTuple<T>(_ args: [T]) -> (T, T, T, T) { (args[0], args[1], args[2], args[3]) }
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

let (n, m, x, y) = toTuple(readInts())
let xi = readInts().sorted(by: >)
let yi = readInts().sorted()
var z = -100
var ok = false
while !ok && z <= 100 {
  ok = xi[0] < z && yi[0] >= z && x < z && z <= y
  z += 1
}
print(ok ? "No War" : "War")
//  [swift]
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    func count() -> Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
}
extension Array where Element: Comparable {
    func max() -> Element! {
        return self.maxElement()
    }
    func min() -> Element! {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/



/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (X, Y) = (input[2], input[3])
let maxX = readIntSplit(by: " ").sorted().reversed()[0]
let minY = readIntSplit(by: " ").sorted()[0]
for Z in X+1...Y {
    if maxX < Z && minY >= Z {
        print("No War")
        break
    }
    if Z == Y {
        print("War")
    }
}
//  [swift]
import Foundation
func toTuple<T>(_ args: [T]) -> (T, T, T, T) { (args[0], args[1], args[2], args[3]) }
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

let (n, m, x, y) = toTuple(readInts())
let xi = readInts().sorted(by: >)
let yi = readInts().sorted()

var count = 1
var ok = false
while !ok && count <= 100 {
  ok = xi[0] < count && yi[0] >= count && x < count && y >= count
  count += 1
}
print(ok ? "No War" : "War")
//  [swift]
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    func count() -> Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
}
extension Array where Element: Comparable {
    func max() -> Element! {
        return self.maxElement()
    }
    func min() -> Element! {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/



/*************** メインプログラム ***************/

let input = readIntSplit(by: " ")
let (N, M, X, Y) = (input[0], input[1], input[2], input[3])
let minX = readIntSplit(by: " ").sorted()[0]
let maxY = readIntSplit(by: " ").sorted().reversed()[0]
for Z in X+1...Y {
    if minX < Z && maxY >= Z {
        print("No War")
        break
    }
    if Z == Y {
        print("War")
    }
}
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);const tn=():number=>{const a=input[0];input.shift();return Number(a)};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{const a=input[0];input.shift();return String(a)};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const tc=():string=>{let a=input[0].split('');const b=a[0];a.shift();if(a.length>0){input[0]=a.join('')}else{input.shift()}return String(b)};const tcc=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(tc())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const gojo=(a:number,b:number):number=>{if(a%b===0)return b;return gojo(b,a%b)};
const main=()=>{
  let[n,m,x,y]=tnn(4)
  let[xx,yy]=[tnn(n),tnn(m)]
  let f;
  for(let j=x+1;j<=y;j++){
    f=false
    for(let i=0;i<n;i++){
      if(xx[i]>=j){
        f=true
        break
      }
    }
    for(let i=0;i<m;i++){
      if(yy[i]<j){
        f=true
        break
      }
    }
    if(!f){break}
  }
  to(f?'War':'No War')
}
main()
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [n, m, _x, _y] = stdin.split('\n')[0].split(' ').map(Number)
const x = stdin.split('\n')[1].split(' ').map(Number)
const y = stdin.split('\n')[2].split(' ').map(Number)

const xMax = Math.max(...x)
const yMin = Math.min(...y)

const ans = _ => {
  for(let i = _x + 1; i <= _y; i++){
    if(xMax < i && yMin >= i){
      return 'No War'
    }
  }
  return 'War'  
}

console.log(ans())
//  [typescript]
{
	const process = (a: string[][]): string => {
		const aa = a.map((e) => e.map((ee) => parseInt(ee)))
		const n = aa[0][0]
		const m = aa[0][1]
		const x = aa[0][2]
		const y = aa[0][3]
		const xx = aa[1]
		const yy = aa[2]

		if (y - x <= 0) {
			return "War"
		}
		const xxMax = Math.max(...xx)
		const yyMin = Math.min(...yy)

		if (yyMin - xxMax <= 0) {
			return "War"
		}

		if (yyMin > x && xxMax < y) {
			return "No War"
		}
		return "War"
	}

	const Main = (input: string): void => {
		//const n: number = parseInt(input)
		//const a: string[]  = input.split(" ")
		const aa: string[][]  = input.split("\n").map((e) => e.split(" "))
		console.log(process(aa))
	}

	Main(require("fs").readFileSync("/dev/stdin", "utf8"))
}
//  [typescript]
{
	const process = (a: string[][]): string => {
		const aa = a.map((e) => e.map((ee) => parseInt(ee)))
		const n = aa[0][0]
		const m = aa[0][1]
		const x = aa[0][2]
		const y = aa[0][3]
		const xx = aa[1]
		const yy = aa[2]

		if (y - x <= 0) {
			return "War"
		}
		const xxMax = Math.max(...xx)
		const yyMin = Math.min(...yy)
		console.log(x, y, xxMax, yyMin)

		if (yyMin - xxMax <= 0) {
			return "War"
		}

		if (yyMin > x && xxMax < y) {
			return "No War"
		}
		return "War"
	}

	const Main = (input: string): void => {
		//const n: number = parseInt(input)
		//const a: string[]  = input.split(" ")
		const aa: string[][]  = input.split("\n").map((e) => e.split(" "))
		console.log(process(aa))
	}

	Main(require("fs").readFileSync("/dev/stdin", "utf8"))
}
//  [typescript]
var int = x=>parseInt(x,10);var spln = x=>x.split(/\n/g);var spsp = x=>x.split(/\s/g);
function main(input) {
  var a = input.split(/\n/g)
  var p = a[0].split(/\s/g).map((v)=>parseInt(v,10))
  var n = parseInt(p[0],10)
  var m = parseInt(p[1],10)
  var x = a[1].split(/\s/g).map((v)=>parseInt(v,10)).slice(0,n)
  x.push(n)
  x = x.sort((a,b)=>{
    	if( a > b ) return -1;
        if( a < b ) return 1;
        return 0;
})
  var y = a[2].split(/\s/g).map((v)=>parseInt(v,10)).slice(0,m)
  y.push(m)
  y = y.sort((a,b)=>{
        if( a < b ) return -1;
        if( a > b ) return 1;
        return 0;
})

  if(x[0]>=y[0]){
     console.log('War')
  }else{
     console.log('No War')
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [python]
import itertools
H,W,K=map(int,input().split())

C=[]

for i in range(H):
  C.append(input())

ans=0
for i in range(H+1):
  for j in range(W+1):
    for n in itertools.combinations(list(range(H)),i):
      for m in itertools.combinations(list(range(W)),j):
        count = 0
        for a in n:
          for b in m:
            if(C[a][b]=="#"):count+=1
        if(count == K):
          ans += 1
print(ans)
//  [python]
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
from itertools import product
def main():
    h, w, k = map(int, input().split())
    gg = []
    for _ in range(h):
        row = [1 if c == '#' else 0 for c in list(input())]
        gg.extend(row)
    row_pro = tuple(product((0, 1), repeat=h))
    col_pro = tuple(product((0, 1), repeat=w))
    rows = []
    for re in row_pro:
        rows.append([i for i, b in enumerate(re) if b])
    cols = []
    for ce in col_pro:
        cols.append([i for i, b in enumerate(ce) if b])
    pat = tuple(product(rows, cols))
    r = 0
    for pate in pat:
        t0 = 0
        for p0 in pate[0]:
            for p1 in pate[1]:
                t0 += gg[p0*w + p1]
        if t0 == k:
            r += 1
    print(r)

if __name__ == '__main__':
    main()
//  [python]
H,W,K = map(int, input().split())
C = [input() for _ in range(H)]
ANS = 0

for i in range(1<<W):
    D = [0]*37
    D[0] = 1

    for c in C:
        cnt = 0
        for b in range(6):
            if (i & (1<<b)) and c[b] == '#':
               cnt += 1

        for j in range(36-cnt, -1, -1):
            D[j+cnt] += D[j]

    ANS += D[K]

print(ANS)
//  [python]
N = int(input())

ans = 0
for i in range(1, N):
    ans += (N-1) // i

print(ans)
//  [python]
import sys
H,W,K = map(int,input().split())
s = [list(input()) for i in range(H)]
laynum = []
rownum = []
for i in range(H):
    blnum = 0
    for j in range(W):
        if s[i][j] == "#":
            blnum += 1
    laynum.append(blnum)
for i in range(W):
    blnum = 0
    for j in range(H):
        if s[j][i] == "#":
            blnum+=1
    rownum.append(blnum)
total = sum(laynum)
if total == K:
    print(1)
    sys.exit()
way = 0
for i in laynum:
    for j in rownum:
        if i==total-K or j==total-K or j+i==total-K:
            way+=1
for s in range(0,len(laynum)):
    for t in range(s+1,len(laynum)):
        if laynum[s]+laynum[t] == total-K:
            way+=1
for s in range(0,len(rownum)):
    for t in range(s+1,len(rownum)):
        if rownum[s]+rownum[t] == total-K:
            way+=1
print(way)
//  [python]
H,W,K = map(int,input().split())
s = [list(input()) for i in range(H)]
laynum = []
rownum = []
for i in range(H):
    blnum = 0
    for j in range(W):
        if s[i][j] == "#":
            blnum += 1
    laynum.append(blnum)
for i in range(W):
    blnum = 0
    for j in range(H):
        if s[j][i] == "#":
            blnum+=1
    rownum.append(blnum)
total = sum(laynum)
way = 0
for i in laynum:
    for j in rownum:
        if i==total-K or j==total-K or j+i==total-K:
            way+=1
for s in range(0,len(laynum)):
    for t in range(s+1,len(laynum)):
        if laynum[s]+laynum[t] == total-K:
            way+=1
for s in range(0,len(rownum)):
    for t in range(s+1,len(rownum)):
        if rownum[s]+rownum[t] == total-K:
            way+=1
if way == 0:
    way = 1
print(way)
//  [java]


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        FastReader s = new FastReader();
        int h = s.nextInt();
        int w = s.nextInt();
        int k = s.nextInt();
        char [][] arr = new char[h][w];
        String s1;
        int bl,wh;
        bl=0;
        wh=0;
        for(int i=0;i<h;i++){
            s1=s.next();
            for(int j=0;j<w;j++){
                arr[i][j]=s1.charAt(j);
            }
        }
        int res=0;
        for (int i = 0; i < (1 << h); ++i) {
            for (int j = 0; j < (1 << w); ++j) {
                int cur = 0;
                for (int l = 0; l < h; ++l) {
                    for (int m = 0; m < w; ++m) {
                        if (((i&(1 << l))!=0) || (j & (1 << m)) !=0) {
                            continue;
                        }
                        if(arr[l][m] == '#')
                            cur++;
                    }
                }
                if(cur==k)
                    res++;
            }
        }
        System.out.println(res);
    }

    private static boolean isPrime(int n) {
        if (n == 2)
            return true;
        else if ((n % 2 == 0 && n > 2) || n < 2)
            return false;
        else {
            for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {
                if (n % i == 0)
                    return false;
            }
            return true;
        }


    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}
//  [java]
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int h = sc.nextInt();
		int w = sc.nextInt();
		int k = sc.nextInt();
		char[][] grid = new char[h][w];
		for(int i = 0; i < h; i++){
		    String s = sc.next();
		    grid[i] = s.toCharArray();
		}
		
		
		// 計算
		long result = 0;
		for(int ih = 0; ih < (1<<h); ih++){
			for(int iw = 0; iw < (1<<w); iw++){
			    long cnt = 0;
			    for(int i = 0; i < h; i++){
		            for(int j = 0; j < w; j++){
		                if(((ih>>i)&1) == 1) continue;
		                if(((iw>>j)&1) == 1) continue;
		                if(grid[i][j] == '#') cnt++;
		            }
		        }
		        if(cnt == k) result++;
			}
		}
		
		
		// 出力
		System.out.println(result);
	}
	
	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
}
//  [java]
import java.util.*;
import java.io.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int h = sc.nextInt();
        int w = sc.nextInt();
        int k = sc.nextInt();
        char[][] map = new char[h][w];
        int total = 0;
        for(int i = 0; i < h; i++){
            map[i] = sc.next().toCharArray();
        }
        int ans = 0;
        for(int i = 0; i < (1 << h); i++){
            for(int j = 0; j < (1 << w); j++){
                int tmp = 0;
                for(int i2 = 0; i2 < h; i2++){
                    if((i >> i2) % 2 == 1){
                        for(int j2 = 0; j2 < w; j2++){
                            if((i >> i2) % 2 == 1){
                                if((j >> j2) % 2 == 1 && map[i2][j2] == '#'){
                                    tmp++;
                                }
                            }
                        }
                    }
                }
                if(tmp == k){
                    ans++;
                }
            }
        }
        System.out.println(ans);
    }
    
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
    }
    
    public String[] nextArray(int n) {
        String[] a = new String[n];
        for (int i = 0; i < n; i++)
            a[i] = next();
        return a;
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}
//  [java]
import java.util.*;
public class Atcoder4 {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int w = sc.nextInt();
		int k = sc.nextInt();
		int count_Bl=0;
		int result=0;
		int[][] board =new int[h][w];
		
		for(int i=0;i<h;i++){
			String input=sc.next();
			for(int j=0;j<w;j++){
				if(input.charAt(j)=='#'){
					board[i][j] = 1;
				}else{
					board[i][j] = 0;
				}

			}
		}  
		for(int i=0;i<Math.pow(2,h);i++){
			String paH=String.format("%6s",Integer.toBinaryString(i));
			for(int j=0;j<Math.pow(2,w);j++){
				String paW=String.format("%6s",Integer.toBinaryString(j));

				for(int n=0;n<h;n++){
					for(int m=0;m<w;m++){
						if(paH.charAt(6-h+n)!='1' && paW.charAt(6-w+m)!='1'){
							if(board[n][m]==1){
								count_Bl+=1;
							}
						}
					}   
				}
				if(count_Bl==k){
					result+=1;
				}
				count_Bl=0;
			} 
		}
		System.out.println(result);
	} 
}
//  [java]

import java.util.Scanner;

//解説を参考した
public class Main{
    public static int change(String s) {
        if (s.equals("#"))
            return 1;
        return 0;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int H = sc.nextInt();
        final int W = sc.nextInt();
        final int K = sc.nextInt();

        String[][] s = new String[H][W];

        for (int i = 0; i < H; i++)
            for (int j = 0; j < W; j++)
                s[i][j] = sc.next();

        int ans = 0;
        for (int is = 0; is < (1 << H); is++) {
            for (int js = 0; js < (1 << W); js++) {

                int count = 0;
                for (int i = 0; i < H; i++) {
                    for (int j = 0; j < W; j++) {
                        //マスが消されているならcontinueする
                        if (((is >>> i) & 1) > 0)
                            continue;
                        if (((js >>> j) & 1) > 0)
                            continue;
                        if (s[i][j].equals("#"))
                            ++count;
                    }
                }
                if (count == K) ++ans;

            }
        }

        System.out.println(ans);

    }

}
//  [java]
import java.util.Scanner;

//解説を参考した
public class Main{
	public static int change(String s) {
		if (s.equals("#"))
			return 1;
		return 0;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		final int H = sc.nextInt();
		final int W = sc.nextInt();
		final int K = sc.nextInt();

		String[][] s = new String[H][W];

		for (int i = 0; i < H; i++)
			for (int j = 0; j < W; j++)
				s[i][j] = sc.next();

		int ans = 0;
		for (int is = 0; is < (1 << H); is++) {
			for (int js = 0; js < (1 << W); js++) {
				
				int count = 0;
				for (int i = 0; i < H; i++) {
					for (int j = 0; j < W; j++) {
						//マスが消されているならcontinueする
						if (((is >>> i) & 1) == 1)
							continue;
						if (((js >>> j) & 1) == 1)
							continue;
						if (s[i][j].equals("#"))
							++count;
					}
				if (count == K)
					++ans;
				}
				
			}
		}

		System.out.println(ans);

	}

}
//  [cpp]

#include <algorithm>
#include <cstdio>
#include <cstring>
#include <map>
#include <math.h>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

typedef long long ll;

char a[8][8];

int solve (int H, int W, int K) {
   int res = 0;
   for (int hMask = 0; hMask < (1 << H); hMask++) {
      for (int wMask = 0; wMask < (1 << W); wMask++) {
         int count = 0;
         for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
               if (a[i][j] == '#'
                  && !(hMask & (1 << i))
                  && !(wMask & (1 << j))) {
                  count++;
               }
            }
         }
         if (count == K) {
            res++;
         }
      }
   }
   return res;
}

int main() {

   int H, W, K;
   scanf("%d %d %d", &H, &W, &K);

   for (int i = 0; i < H; i++) {
      scanf("%s", a[i]);
   }

   int ans = solve(H, W, K);
   printf("%d\n", ans);

   return 0;
}
//  [cpp]
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define mt make_tuple
#define MOD 1000000007
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vl vector <long long int>
#define pii pair <int,int>
#define pll pair <long long int, long long int>
#define vpii vector< pair<int,int> >
#define vpll vector < pair <long long int,long long int> >
#define boost ios::sync_with_stdio(false); cin.tie(0)
using namespace std;
const int inf = 1e9 + 5;
const ll inf64 = 1e18 + 5;

int main()
{
	boost;
	int n, m, z, i, j;
	cin >> n >> m >> z;
	char arr[n][m], b[n][m];
	fo(i, 0, n) {
		fo(j, 0, m)
		cin >> arr[i][j];
	}
	
	int ans = 0;
	for(int i = 0; i < (1 << n); i++) {
		for(int j = 0; j < (1 << m); j++) {
			for(int k = 0; k < n; k++) {
				for(int k1 = 0; k1 < m; k1++)
				b[k][k1] = arr[k][k1];
			}
			
			for(int k = 0; k < n; k++) {
				if(i >> k & 1) {
					for(int k1 = 0; k1 < m; k1++)
					b[k][k1] = '.';
				}
			}
			
			for(int k = 0; k < m; k++) {
				if(j >> k & 1) {
					for(int k1 = 0; k1 < n; k1++)
					b[k1][k] = '.';
				}
			}
			
			int cnt = 0;
			for(int k = 0; k < n; k++) {
				for(int k1 = 0; k1 < m; k1++)
				cnt += (b[k][k1] == '#');
			}
			if(cnt == z) ++ans;
		}
	}
	cout << ans;
}
//  [cpp]
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    int h,w,k;
    cin>>h>>w>>k;
    char c[h][w];
    rep(i,h){
        rep(j,w) cin>>c[i][j];
    }
    int ans=0;
    for(int i=0;i<(1<<h);i++){
        for(int j=0;j<(1<<w);j++){
            int cnt=0;
            rep(l,h){
                rep(m,w){
                    if(c[l][m]=='#') cnt++;
                }
            }
            if(cnt==k) ans++;
        }
    }
    cout<<ans;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

int main(){
  int H,W,K;cin>>H>>W>>K;
  char A[H][W];
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++) cin>>A[i][j];
  }
  int ans=0;
  for(int s=0;s<(1<<H);s++){
    for(int t=0;t<(1<<W);t++){
      int black=0;
      for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
          if(((s>>i) & 1)==0 && ((t>>j) &1)== 0 && A[i][j]=='#') black++;
          
          if(black==K) ans++;
        }
      }
    }
  }
  cout<<ans<<endl;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

int main(){
  int H,W,K;cin>>H>>W>>K;
  char A[H][W];
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++) cin>>A[i][j];
  }
  int ans=0;
  for(int s=0;s<(1<<H);s++){
    for(int t=0;t<(1<<W);t++){
      int black=0;
      for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
          if(((s>>i) & 1)==0 && ((t>>j) &1)== 0 && C[i][j]=='#') black++;
          
          if(black==K) ans++;
        }
      }
    }
  }
  cout<<ans<<endl;
}
//  [c]
#include <stdio.h>
#define SIZE 6

int bi1[SIZE], bi2[SIZE];
const int disit[SIZE + 1] = {1, 2, 4, 8, 16, 32, 64};

void de_bi1(int de){
  int i;
  for(i = SIZE-1; i >= 0; i--){
    bi1[i] = de / disit[i];
    de %= disit[i];
  }
  return;
}

void de_bi2(int de){
  int i;
  for(i = SIZE-1; i >= 0; i--){
    bi2[i] = de / disit[i];
    de %= disit[i];
  }
  return;
}

int main(void){
  int row, col, n, sum = 0, ans = 0, i, j, k, l;
  char bw[SIZE][SIZE];
  scanf("%d %d %d", &row, &col, &n);
  
  for(i = 0; i < row; i++){
    for(j = 0; j < col; j++){
      scanf(" %c", &bw[i][j]);
    }
  }
  
  for(i = 0; i < disit[row]; i++){
    de_bi1(i);
    for(j = 0; j < disit[col]; j++){
      de_bi2(j);
      for(k = 0; k < row; k++){
        if(bi1[k] == 1){
          for(l = 0; l < col; l++){
            if(bi2[l] == 1){
              if(bw[k][l] == '#')
                sum++;
            }
          }
        }
      }
      if(sum == n)ans++;
      sum = 0;
    }
  }
  
  printf("%d", ans);
  return 0;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
#include<math.h>
#include<limits.h>
#define MAX 6
char table[MAX][MAX];
char table_copy[MAX][MAX];
char table_ori[MAX][MAX];
int H, W, K;
int count()
{
    int ret = 0;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (table[i][j] == '#')
                ret++;
        }
    }
    return ret;
}

int main()
{
    int ans = 0;
    scanf("%d %d %d", &H, &W, &K);
    char str[100];
    for (int i = 0; i < H; i++){
        scanf("%s", str);
        for (int j = 0; j < W; j++) {
            table[i][j] = str[j];
        }
    }

    memcpy(table_ori, table, sizeof(table));

    for (int bit1 = 0; bit1 < (1 << W); bit1++) {
        memcpy(table, table_ori, sizeof(table));
        for (int i = 0; i < W; i++) {
            if (bit1 & (1 << i)) {
                for (int j = 0; j < H; j++)
                    table[j][i] = '*';
            }
        }

        memcpy(table_copy, table, sizeof(table));

        for (int bit2 = 0; bit2 < (1 << H); bit2++) {
            memcpy(table, table_copy, sizeof(table));
            for (int k = 0; k < H; k++) {
                if (bit2 & 1 << k) {
                    for (int l = 0; l < W; l++)
                        table[k][l] = '*';
                }
            }
            if (count() == K)
                ans++;
        }
    }

    printf("%d", ans);
}
//  [c]
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))

typedef long long int ll;

int read_int()
{
    int a;
    scanf("%d", &a);
    return a;
}

int read_lint()
{
    ll a;
    scanf("%lld", &a);
    return a;
}

int read_float()
{
    float a;
    scanf("%f", &a);
    return a;
}

char read_char()
{
    char c;
    scanf("%c", &c);
    return c;
}

int read_double()
{
    double a;
    scanf("%lf", &a);
    return a;
}

void read_string(char *s)
{
    scanf("%s", s);
}

#define N 6

char c[N][N + 1];
char t[N][N + 1];

int main()
{
    ll h = read_lint();
    ll w = read_lint();
    ll k = read_lint();
    for (int i = 0; i < h; i++)
    {
        read_string(c[i]);
    }

    ll ans = 0;
    ll paternh = (int)pow(2.0, (double)h);
    ll paternw = (int)pow(2.0, (double)w);
    for (int i = 0; i < paternh; i++)
    {
        for (int j = 0; j < paternw; j++)
        {
            for (int l = 0; l < h; l++)
            {
                strcpy(t[l], c[l]);
            }

            int mask = 1;
            for (int l = 0; l < h; l++)
            {
                if (i & mask)
                {
                    for (int m = 0; m < w; m++)
                    {
                        t[l][m] = '.';
                    }
                }
                mask <<= 1;
            }

            mask = 1;
            for (int l = 0; l < w; l++)
            {
                if (j & mask)
                {
                    for (int m = 0; m < h; m++)
                    {
                        t[m][l] = '.';
                    }
                }
                mask <<= 1;
            }

            ll black = 0;
            for (int l = 0; l < h; l++)
            {
                for (int m = 0; m < w; m++)
                {
                    if (t[l][m] == '#')
                    {
                        black++;
                    }
                }
            }

            // printf("%lld\n", black);
            if (black == k)
            {
                ans++;
            }
        }
    }

    printf("%lld\n", ans);

    return 0;
}
//  [c]
#include <stdio.h>
#define MAX_H 6
#define MAX_W 6
 
int two_exp(int x) {
  int n =1;
  int i;
  for (i=0; i<x; i++) {
    n *= 2;
  }
  return n;
}
 
int main(void) {
  int h, w, k;
  int i, j;
  int ans = 0;
  char col[MAX_H+1][MAX_W+1] = {0};
  scanf("%d%d%d",&h,&w,&k);
  for (i=0;i<h;i++) {
      scanf("%s",col[i]);
  }
  
  for (i=0; i<two_exp(h);i++) {
    for (j=0; j<two_exp(w);j++) {
      int t, s;
      int block = 0;
      for (t=0; t<h; t++) {
        if (block>k) {
          break;
        }
        for (s=0; s<w; s++) {
          if (col[t][s]=='#' && (1<<t & i == 0) && (1<<s & j == 0)) {
            block++;
          }
          if (block>k) {
            break;
          }
        }
      }
      if (block == k) ans++;
    }
  }
  
  printf("%d",ans);
  return 0;
}
//  [c]
#include <stdio.h>
#define MAX_H 6
#define MAX_W 6
 
int two_exp(int x) {
  int n =1;
  int i;
  for (i=0; i<x; i++) {
    n *= 2;
  }
  return n;
}
 
int main(void) {
  int h, w, k;
  int i, j;
  int ans = 0;
  char col[MAX_H][MAX_W+1] = {0};
  scanf("%d%d%d",&h,&w,&k);
  for (i=0;i<h;i++) {
      scanf("%s",col[i]);
  }
  
  for (i=0; i<two_exp(h);i++) {
    for (j=0; j<two_exp(w);j++) {
      int t, s;
      int block = 0;
      for (t=0; t<h; t++) {
        if (block>k) {
          break;
        }
        for (s=0; s<w; s++) {
          if (col[t][s]=='#' && (1<<t & i == 0) && (1<<s & j == 0)) {
            block++;
          }
          if (block>k) {
            break;
          }
        }
      }
      if (block == k) ans++;
    }
  }
  
  printf("%d",ans);
  return 0;
}
//  [c]
#include <stdio.h>
#define MAX_H 6
#define MAX_W 6
 
int two_exp(int x) {
  int n =1;
  int i;
  for (i=0; i<x; i++) {
    n *= 2;
  }
  return n;
}
 
int main(void) {
  int h, w, k;
  int i, j;
  int ans = 0;
  char col[MAX_H][MAX_W+1] = {0};
  scanf("%d%d%d",&h,&w,&k);
  for (i=0;i<h;i++) {
      scanf("%s",&col[i][0]);
  }
  
  for (i=0; i<two_exp(h);i++) {
    for (j=0; j<two_exp(w);j++) {
      int t, s;
      int block = 0;
      for (t=0; t<h; t++) {
        if (block>k) {
          break;
        }
        for (s=0; s<w; s++) {
          if (col[t][s]=='#' && (1<<t & i == 0) && (1<<s & j == 0)) {
            block++;
          }
          if (block>k) {
            break;
          }
        }
      }
      if (block == k) ans++;
    }
  }
  
  printf("%d",ans);
  return 0;
}
//  [javascript]
var GET = (function () {function f(s) {return new g(s);}function g(s) {this._s = s.trim().split("\n");}g.prototype.getValue = function (n) {return this._s[n];};g.prototype.getArray = function (n) {return this.stoa(this._s[n]);};g.prototype.slice = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stox(v));};g.prototype.sliceArray = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stoa(v));};g.prototype.stoa = function (s) {return s.split(" ").map(v => this.stox(v));};g.prototype.stox = function (v) {var i = +v;return (i === i) ? i : v;};return f;})();
var o = GET(require("fs").readFileSync("/dev/stdin", "utf8"));

console.log(main());

function main() {
    var v1 = o.getArray(0);
    var H = +v1[0];
    var W = +v1[1];
    var K = +v1[2];

    var cn = [];
    for (var i = 0; H > i; i++) {
        cn.push(o.getValue(i + 1));
    }

    var result = 0;
    for (let bit = 0; bit < (1 << H); bit++) {
        for (let wbit = 0; wbit < (1 << W); wbit++) {
            let count = 0;
            for (let i = 0; i < H; i++) {
                if (bit & (1 << i)) continue;
                for (let j = 0; j < W; j++) {
                    if (wbit & (1 << j)) continue;
                    if (cn[i][j] === '#') {
                        count++;
                    }
                }
            }
            if (count === K) {
                result++;
            }
        }
    }
    return result;
}
//  [javascript]
'use strict';
function Main(stdin){
  const input = stdin.trim().split(/\r?\n/g);
  const [h,w,k] = input.shift().split(' ').map(Number);
  const c = input;
  let result = 0;
  for(let is = 0; is < 1 << h; is++){
    for(let js = 0; js < 1 << w; js++){
    let sum = 0;
      for(let i = 0; i < h; i++){
        if((is >> i) & 1) continue;
        for(let j = 0; j < w; j++){
          if((js >> j) & 1) continue;
          if(c[i][j] === "#") sum++;
        }
      }
      if(sum === k) result++;
    }
  }
  console.log(result);
}
// 固定
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(){return +cin[cid++];}
function nextstr(){return cin[cid++];}
function nextbig(){return BigInt(cin[cid++]);}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(String(myOut));

function main(){
  var [h,w,k] = nexts(3);
  var c = nexts(h,1);
  var ans = 0;
  for(var y = 0; y < 1 << h; y++)for(var x = 0; x < 1 << w; x++){
    var sum = 0;
    for(var y2 = 0; y2 < h; y2++){
      if((y >> y2) & 1)continue;
      for(var x2 = 0; x2 < w; x2++){
        if((x >> x2) & 1)continue;
        if(c[y2][x2] === "#")sum++;
      }
    }
    if(sum === k)ans++;
  }
  return ans;
}
//  [javascript]
console.log(this)
//  [javascript]
const solve = (data, H, W, K, debug = 0) => {
  const _ = (i, j) => i * W + j;
  let result = 0;

  // Enumerate 2^H, 2^W
  for (let rows = 0; rows < 2 ** W; rows++) {
    for (let cols = 0; cols < 2 ** H; cols++) {
      // Count surviving black entries
      let count = 0;
      for (let i = 0; i < H; i++) {
        for (let j = 0; j < W; j++) {
          if (data[_(i, j)] && ((1 << i) & rows) && ((1 << j) & cols)) {
            count++;
          }
        }
      }

      if (count === K) {
        result++;
      }
    }
  }
  return result;
};

const main = async (istr, ostr) => {
  const readline = require('readline');
  const it = readline.createInterface({input: istr})[Symbol.asyncIterator]();
  const getLine = async () => (await it.next()).value;
  const getMany = async () => (await getLine()).split(' ');

  const [H, W, K] = (await getMany()).map(Number);
  const data = new Uint8Array(H * W);
  const _ = (i, j) => i * W + j;
  for (let i = 0; i < H; i++) {
    const line = await getLine();
    for (let j = 0; j < W; j++) {
      data[_(i, j)] = line[j] === '#';
    }
  }
  const result = solve(data, H, W, K);
  ostr.write(`${result}\n`);
};

if (require.main === module) {
  main(process.stdin, process.stdout);
}