func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<long long> g[(long long)3e5], a((long long)3e5);   long long i, n, x, y, r;   void b(long long p, long long q, long long m) {     a[p]++, r += m;     for (auto j : g[p])       if (j != q) b(j, p, m ^ 1), a[p] += a[j];   }   int main() {     for (cin >> n, i = 1; i < n; i++)       cin >> x >> y, g[x].push_back(y), g[y].push_back(x);     b(1, 0, 0), r *= (n - r);     for (i = 1; i <= n; i++) r += a[i] * (n - a[i]);     cout << r / 2;   }   