The depth of a complete derivation d is the length of the longest path from the root to a leaf in the parse tree associated with d. The length of a path is defined as the number of nodes it visits.
if d = π for some rule π = (A → w) with w ∈ Σ * , then the depth of d is 2.