Exercise 3.27: depth