Maximum depth of a tree