#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
vector<int> adj[N];
long long n, u_g[N], u_p[N], sz[N], dp[N], son[N], ans;
int dfs(int u, int p, int gp) {
  sz[u] = 1, u_p[u] = p, u_g[u] = gp;
  dp[u] = adj[u].size() - (p ? 1 : 0);
  for (auto c : adj[u])
    if (c != p) sz[u] += dfs(c, u, p), son[u];
  dp[gp] += dp[u] + sz[u];
  return sz[u];
}
void solve(int u, int p) {
  ans += dp[u];
  for (auto c : adj[u]) {
    if (c != p) {
      long long u_dp = dp[u], c_dp = dp[c];
      long long u_sz = sz[u], c_sz = sz[c];
      long long u_son = son[u], c_son = son[c];
      dp[u] -= (son[c] + 1);
      sz[u] -= sz[c];
      son[u] -= (dp[c] + sz[c]);
      dp[c] += son[u] + 1;
      sz[c] += sz[u];
      son[c] += dp[u] + sz[u];
      solve(c, u);
      dp[u] = u_dp, sz[u] = u_sz, son[u] = u_son;
      dp[c] = c_dp, sz[c] = c_sz, son[c] = c_son;
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 0, 0);
  for (int i = 1; i <= n; ++i)
    for (auto c : adj[i]) son[i] += dp[c] + sz[c];
  dp[0] = 0;
  solve(1, 0);
  cout << ans / 2;
  return 0;
}
