#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long sum = 0, f = 0;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar()) f |= (ch == '-');
  for (; isdigit(ch); ch = getchar())
    sum = ((sum << 1) + (sum << 3) + (ch ^ 48));
  return f ? -sum : sum;
}
void write(const long long x) {
  if (x < 0) {
    putchar('-');
    write(-x);
    return;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
long long n, x, y, tot, ans, ji[220000], ou[220000], f[220000], head[220000];
struct node {
  int to, nxt;
} e[220000 * 2];
void add(long long f, long long to) {
  e[++tot].to = to;
  e[tot].nxt = head[f];
  head[f] = tot;
}
void dfs(long long u, long long fa) {
  ji[u] = 0;
  ou[u] = 1;
  for (long long i = head[u], v = e[i].to; i; i = e[i].nxt, v = e[i].to)
    if (v != fa) dfs(v, u);
  ji[fa] += ou[u];
  ou[fa] += ji[u];
  f[fa] += f[u] + ou[u];
}
void dfs2(long long u, long long fa) {
  f[u] += f[fa] - f[u] - ou[u] + ou[fa] - ji[u];
  ji[u] += ou[fa] - ji[u], ou[u] += ji[fa] - ou[u];
  for (long long i = head[u], v = e[i].to; i; i = e[i].nxt, v = e[i].to)
    if (v != fa) dfs2(v, u);
}
int main() {
  n = read();
  for (register long long i = (1); i <= (n - 1); i++)
    x = read(), y = read(), add(x, y), add(y, x);
  dfs(1, 0);
  dfs2(1, 0);
  for (register long long i = (1); i <= (n); i++) ans += f[i];
  write(ans / 2);
}
