  Combinatorial enumeration of various RNA secondary structures and protein
contact maps, is of great interest for both combinatorists and computational
biologists. Enumeration of protein contact maps has considerable difficulties
due to the significant higher vertex degree than that of RNA secondary
structures. The state of art maximum vertex degree in previous works is two.
This paper proposes a solution for counting stacks in protein contact maps with
arbitrary vertex degree upper bound. By establishing bijection between such
general stacks and $m$-regular $\Lambda$-avoiding $DLU$ paths, and counting the
paths using theories of pattern avoiding lattice paths, we obtain a unified
system of equations for generating functions of general stacks. We also show
that previous enumeration results for RNA secondary structures and protein
contact maps can be derived from the unified equation system as special cases.
