#include <bits/stdc++.h>
using namespace std;
long long modpow(long long a, long long b,
                 long long mod = (long long)(1e9 + 7)) {
  if (!b) return 1;
  a %= mod;
  return modpow(a * a % mod, b / 2, mod) * (b & 1 ? a : 1) % mod;
}
const int maxn = 2e5;
int n;
vector<int> adj[maxn];
int subsz[maxn], centroidParent[maxn];
bool marked[maxn];
long long ans = 0;
int dfsSubsz(int v, int p) {
  if (marked[v]) return 0;
  subsz[v] = 1;
  for (int w : adj[v])
    if (w != p && !marked[w]) subsz[v] += dfsSubsz(w, v);
  return subsz[v];
}
int dfsCentroid(int v, int p, int sz) {
  for (int w : adj[v])
    if (w != p && !marked[w] && subsz[w] > sz / 2) return dfsCentroid(w, v, sz);
  return v;
}
void dfs(int v, int p, int d, long long preo, long long pree, int sz,
         int &toinc, long long &incpree, long long &incpreo) {
  toinc++;
  incpreo += d / 2 + 1;
  incpree += (d + 1) / 2;
  if (d & 1)
    ans += (long long)sz * (d / 2) + preo;
  else
    ans += (long long)sz * (d / 2) + pree;
  ans += (d + 1) / 2;
  for (int w : adj[v])
    if (w != p && !marked[w])
      dfs(w, v, d + 1, preo, pree, sz, toinc, incpree, incpreo);
}
void decompose(int v, int p) {
  dfsSubsz(v, p);
  int centroid = dfsCentroid(v, p, subsz[v]);
  centroidParent[centroid] = p;
  marked[centroid] = true;
  int sum = 0;
  long long preo = 0, pree = 0;
  for (int w : adj[centroid]) {
    if (!marked[w]) {
      int toinc = 0;
      long long incpree = 0, incpreo = 0;
      dfs(w, centroid, 1, preo, pree, sum, toinc, incpree, incpreo);
      pree += incpree, preo += incpreo;
      sum += toinc;
    }
  }
  for (int w : adj[centroid])
    if (!marked[w]) decompose(w, centroid);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    scanf("%d", &x), scanf("%d", &y);
    x--, y--;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  memset(subsz, 0, sizeof(subsz));
  memset(marked, false, sizeof(marked));
  ans = 0;
  decompose(0, -1);
  cout << ans << endl;
  return 0;
}
