At the very beginning, Victor has a proposition, then this proposition procudes many propositions. Then every proposition procudes more propositions...... Finally there are $n$ propositions. These propositions can be regarded as a tree whose root is $1$.
We assume that the first proposition, whose number is $1$, belongs to the $0$-th generation, and those propositions produced by the $x$-th generation belong to the $x+1$-th generation. We also assume that all of the propositions in the $x$-th generation are in level $x$. Specially, Victor has discovered that the proposition whose number is $i$ can infer the proposition whose number is $x_i$ and all of the propositions in $x_i$'s subtree, whose levels are not greater than $x_i$'s level + $d_i$.
Notice : $a$ is $b$'s father does not show that either $a$ can infer $b$ or $b$ can infer $a$.
Now please determine the number of such ordered pairs $(i,j)$, that $1\leq i < j\leq n$, the proposition $i$ can infer the proposition $j$, and the proposition $j$ can also infer the proposition $i$.