#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
struct edge {
  int next, to;
} g[maxn << 1];
int head[maxn], cnt;
void add(int from, int to) {
  g[++cnt].to = to;
  g[cnt].next = head[from];
  head[from] = cnt;
}
int G;
int size[maxn];
bool mark[maxn];
void f_g(int x, int f, int now) {
  size[x] = 1;
  int _max = 0;
  for (int i = head[x]; i; i = g[i].next) {
    int v = g[i].to;
    if (!mark[v] && v != f) {
      f_g(v, x, now);
      size[x] += size[v];
      _max = max(_max, size[v]);
    }
  }
  _max = max(_max, now - size[x]);
  if ((_max << 1) <= now) G = x;
}
long long sum1, sum2;
long long num1, num2;
long long ans;
void f_d(int x, int f, long long dis) {
  if (dis & 1)
    ans += ((sum1 + num1 * dis) >> 1) + ((sum2 + num2 * (dis - 1)) >> 1) + num2;
  else
    ans += ((sum2 + num2 * dis) >> 1) + ((sum1 + num1 * (dis - 1)) >> 1) + num1;
  ans += (dis >> 1) + (dis & 1);
  for (int i = head[x]; i; i = g[i].next) {
    int v = g[i].to;
    if (!mark[v] && v != f) {
      f_d(v, x, dis + 1ll);
    }
  }
}
void f_f(int x, int f, long long dis) {
  if (dis & 1) {
    sum1 += dis;
    num1 += 1ll;
  } else {
    sum2 += dis;
    num2 += 1ll;
  }
  for (int i = head[x]; i; i = g[i].next) {
    int v = g[i].to;
    if (!mark[v] && v != f) {
      f_f(v, x, dis + 1ll);
    }
  }
}
void solve(int x, int now) {
  G = 0;
  f_g(x, 0, now);
  mark[x = G] = 1;
  for (int i = head[x]; i; i = g[i].next) {
    int v = g[i].to;
    if (!mark[v]) {
      f_d(v, x, 1ll);
      f_f(v, x, 1ll);
    }
  }
  sum1 = sum2 = 0;
  num1 = num2 = 0;
  for (int i = head[x]; i; i = g[i].next) {
    int v = g[i].to;
    if (!mark[v]) solve(v, size[v] < size[x] ? size[v] : now - size[x]);
  }
}
int n;
int main() {
  scanf("%d", &n);
  int i, j;
  for (i = 1; i < n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    add(a, b);
    add(b, a);
  }
  solve(1, n);
  printf("%lld\n", ans);
}
