ll@N,@--(U,V)[N-1],E[N]{},a=N-1;REP(i,N-1)E[U[i]]++,E[V[i]]++;REP(i,N)a+=E[i]*E[i]-1/2;REP(i,N-1)a+=(E[U[i]]-1)*(E[V[i]]-1)/2;wt(a);