#include <bits/stdc++.h>
using namespace std;
const long long inf = (1ll << 61);
const int MX = 3e5 + 9;
int n, sub[MX], depth[MX], blocked[MX], par[MX];
long long ans = 0;
vector<int> v[MX];
void dfsbuild(int x, int p) {
  sub[x] = 1;
  par[x] = p;
  for (auto pp : v[x]) {
    if (pp == p || blocked[pp]) continue;
    dfsbuild(pp, x);
    sub[x] += sub[pp];
  }
}
vector<int> nodes;
void dfs(int x, int p, int d) {
  nodes.push_back(d);
  for (auto pp : v[x]) {
    if (blocked[pp] || pp == p) continue;
    dfs(pp, x, d + 1);
  }
}
void create(int x) {
  dfsbuild(x, -1);
  int S = sub[x], ind = -1;
  queue<int> q;
  q.push(x);
  while (!q.empty()) {
    int y = q.front();
    q.pop();
    int s = sub[x] - sub[y];
    for (auto pp : v[y]) {
      if (pp == par[y] || blocked[pp]) continue;
      s = max(s, sub[pp]);
      q.push(pp);
    }
    if (S > s) {
      S = s;
      ind = y;
    }
  }
  blocked[ind] = 1;
  long long sum = 0;
  long long e = 0, o = 0;
  long long ans1 = 0;
  for (auto pp : v[ind]) {
    if (blocked[pp]) continue;
    dfs(pp, -1, 1);
    for (auto pp : nodes) {
      if (pp % 2) {
        ans += sum;
        ans += ((pp + 1) / 2) * e;
        ans += (pp / 2) * o;
      } else {
        ans += sum;
        ans += (pp / 2) * (e + o);
      }
      ans += (pp + 1) / 2;
    }
    for (auto pp : nodes) {
      if (pp % 2)
        o++;
      else
        e++;
      sum += ((pp + 1) / 2);
    }
    nodes.clear();
  }
  for (auto pp : v[ind]) {
    if (blocked[pp]) continue;
    create(pp);
  }
}
int x, y;
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  create(1);
  cout << ans << endl;
}
