#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")
using namespace std;
mt19937 rnd(time(0));
const int maxn = 3e5 + 7, mod = 1e9 + 7, inf = 1e9;
const double eps = 1e-9, pi = acos(-1);
int n;
vector<int> gr[maxn];
vector<int> gr_cd[maxn];
vector<int> lenght[maxn];
int block[maxn];
int siz[maxn];
const int L = 25;
int tin[maxn], tout[maxn], up[maxn][L];
int tm1 = 0, tm2 = 0;
int depth[maxn];
void dfs(int u, int pr, int deep) {
  depth[u] = deep;
  tin[u] = tm1++;
  up[u][0] = pr;
  for (int i = 1; i < L; ++i) {
    up[u][i] = up[up[u][i - 1]][i - 1];
  }
  for (auto v : gr[u]) {
    if (v != pr) {
      dfs(v, u, deep + 1);
    }
  }
  tout[u] = tm2++;
}
bool upper(int u, int v) { return tin[u] <= tin[v] && tout[u] >= tout[v]; }
int lca(int u, int v) {
  if (upper(u, v)) return u;
  if (upper(v, u)) return v;
  for (int i = L - 1; i >= 0; --i) {
    if (!upper(up[u][i], v)) {
      u = up[u][i];
    }
  }
  return up[u][0];
}
int dist(int u, int v) { return depth[u] + depth[v] - 2 * depth[lca(u, v)]; }
int get_siz(int u, int pr) {
  siz[u] = 1;
  for (auto v : gr[u]) {
    if (block[v] || v == pr) continue;
    siz[u] += get_siz(v, u);
  }
  return siz[u];
}
int centroid(int u, int pr, int sz) {
  for (auto v : gr[u]) {
    if (v == pr || block[v]) continue;
    if (siz[v] > sz / 2) return centroid(v, u, sz);
  }
  return u;
}
void get_lenght(int u, int pr, int cd) {
  lenght[cd].push_back(u);
  for (auto v : gr[u]) {
    if (block[v] || v == pr) continue;
    get_lenght(v, u, cd);
  }
}
void divide(int u, int pr) {
  get_siz(u, u);
  int cd = centroid(u, u, siz[u]);
  block[cd] = 1;
  if (pr != -1) gr_cd[pr].push_back(cd);
  get_lenght(cd, cd, cd);
  for (auto v : gr[cd])
    if (!block[v]) divide(v, cd);
}
long long ans = 0;
void get(int cd) {
  vector<int> have;
  for (auto v : gr_cd[cd]) {
    have.push_back(v);
  }
  long long now = 0, cnt_now = 0;
  long long down = 0, cnt_down = 0;
  for (auto p : have) {
    long long p1 = 0, cnt_p1 = 0;
    long long p2 = 0, cnt_p2 = 0;
    for (auto v : lenght[p]) {
      int d1 = dist(cd, v);
      ans += (d1 + 1) / 2;
      if (d1 % 2) {
        long long add = d1 / 2;
        p2 += add;
        cnt_p2++;
        ans += now + (add + 1) * cnt_now;
        ans += down + (add + 1) * cnt_down;
      } else {
        long long add = d1 / 2;
        p1 += add;
        cnt_p1++;
        ans += now + add * cnt_now;
        ans += down + add * cnt_down + cnt_down;
      }
    }
    now += p1;
    cnt_now += cnt_p1;
    down += p2;
    cnt_down += cnt_p2;
  }
}
void solve() {
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    gr[a].push_back(b);
    gr[b].push_back(a);
  }
  dfs(0, 0, 0);
  divide(0, -1);
  for (int i = 0; i < n; ++i) {
    get(i);
  }
  cout << ans;
}
signed main() {
  srand(time(0));
  cout.precision(10);
  cout << fixed;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
