let () = Scanf.scanf "%d %d %d\n" @@ fun h w k ->
  let cs = Array.init h @@ fun _ -> Scanf.scanf "%s\n" @@ fun cs -> cs in
  Printf.printf "%d\n" @@
  Array.fold_left (Array.fold_left ( + )) 0 @@
  Array.init (1 lsl h) @@ fun column ->
    Array.init (1 lsl w) @@ fun row ->
      if
        ( = ) k @@
        Array.fold_left (Array.fold_left ( + )) 0 @@
        Array.init h @@ fun i ->
          Array.init w @@ fun j ->
            if cs.(i).[j] = '#' && column land (1 lsl i) = 0 && row land (1 lsl j) = 0 then 1 else 0
      then 1
      else 0