#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 9;
vector<int> G[N];
long long cnt[N][4];
void dfs(int u, int p) {
  for (int v : G[u])
    if (v != p) {
      dfs(v, u);
      cnt[u][0] += cnt[v][2];
      cnt[u][1] += cnt[v][3] + cnt[v][2];
      cnt[u][2] += cnt[v][0];
      cnt[u][3] += cnt[v][1] + cnt[v][0];
    }
  ++cnt[u][0];
}
long long ans = 0;
void dfs2(int u, int p, long long c0, long long c1, long long c2,
          long long c3) {
  ans += (c1 + cnt[u][1]) / 2 + (c2 + c3 + cnt[u][2] + cnt[u][3]) / 2;
  for (int v : G[u])
    if (v != p) {
      dfs2(v, u, c2 + cnt[u][2] - cnt[v][0],
           c3 + cnt[u][3] - cnt[v][1] - cnt[v][0] + c2 + cnt[u][2] - cnt[v][0],
           c0 + cnt[u][0] - cnt[v][2],
           c1 + cnt[u][1] - cnt[v][3] - cnt[v][2] + c0 + cnt[u][0] - cnt[v][2]);
    }
}
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1, 0);
  dfs2(1, 0, 0, 0, 0, 0);
  printf("%lld\n", ans / 2);
}
int main() {
  int T = 1;
  while (T--) solve();
  return 0;
}
