#include <bits/stdc++.h>
using namespace std;
vector<int> adj[200011];
long long dp[200001], ans;
int c[200001], k[200001], b[200001];
void dfs(int node, int par) {
  long long sumdp = 0, sumc = 0, sumb = 0;
  dp[node] = 0;
  c[node] = 1;
  k[node] = 1;
  for (int i = 0; i < adj[node].size(); i++) {
    int u = adj[node][i];
    if (u == par) continue;
    dfs(u, node);
    c[node] += c[u];
    k[node] += c[u] - k[u];
    dp[node] += dp[u] + k[u];
    ans += sumdp * c[u] + dp[u] * sumc + sumc * c[u] - (c[u] - k[u]) * sumb;
    sumb += c[u] - k[u];
    sumdp += dp[u];
    sumc += c[u];
  }
  ans += dp[node];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, u, v;
  cin >> n;
  ans = 0;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(0, -1);
  cout << ans;
  return 0;
}
