You are given a tree consisting of $n$ vertices numbered $1$ to $n$ rooted at node $1$. The parent of the $i$-th vertices is $p_i$. You can move from a vertex to any of its children. What's more, you can add one directed edge between any two different vertices, and you can move through this edge too. You need to maximize the number of pairs $(x,y)$ such that $x$ can move to $y$ through the edges after adding the edge. Note that $x$ can also move to $x$.