#include <bits/stdc++.h>
using namespace std;
;
long long read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const double eps = 1e-8;
const int mod = 1e9 + 7;
const int maxn = 3e5 + 5;
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
struct EDGE {
  int v, nxt;
} edge[maxn * 2];
int head[maxn];
int vis[maxn];
int tot;
void add_edge(int u, int v) {
  edge[++tot].v = v;
  edge[tot].nxt = head[u];
  head[u] = tot;
}
long long ans = 0;
long long odd = 0;
long long son[maxn];
long long n;
void dfs(int u, int fa, int flag) {
  odd += flag;
  for (int i = head[u]; i != -1; i = edge[i].nxt) {
    int v = edge[i].v;
    if (v == fa) continue;
    dfs(v, u, !flag);
    son[u] += son[v] + 1;
    ans += (long long)(son[v] + 1) * (n - son[v] - 1);
  }
}
int main() {
  scanf("%lld", &n);
  memset(head, -1, sizeof(head));
  tot = 0;
  for (int i = 1, u, v; i < n; i++) {
    scanf("%d%d", &u, &v);
    add_edge(u, v);
    add_edge(v, u);
  }
  ans = 0;
  dfs(1, 0, 1);
  ans += (n - odd) * odd;
  cout << ans / 2 << endl;
  return 0;
}
