let [|H;W;K|] =
    stdin.ReadLine().Split()
    |> Array.map int
let c =
    [|1..H|]
    |> Array.map (fun _ ->
        stdin.ReadLine().ToCharArray()
        |> Array.map (fun x ->
            match x with
            | '.' -> 0
            | '#' -> 1))

let f hs ws =
    c
    |> Array.scan (fun (hs',sum) value ->
        let a = hs'&&&1
        let v =
            value
            |> Array.scan (fun (ws',sum') x ->
                let b = ws'&&&1
                (ws'>>>1,sum'+x*a*b)) (ws,0)
            |> ((fun x -> x.[W]) >> (fun (_,s) -> s))
        (hs'>>>1,sum+v)) (hs,0)
    |> ((fun x -> x.[H]) >> (fun (_,s) -> s))

[|1..int(2.0**float(H))-1|]
|> Array.sumBy (fun x ->
    [|1..int(2.0**float(W))-1|]
    |> Array.sumBy ((f x) >> (fun y ->
        if y=K then 1
        else 0)))
|> stdout.WriteLine