#include <bits/stdc++.h>
using namespace std;
int n, odd[200005], even[200005];
long long dp[200005];
vector<int> g[200005];
void dfs1(int u, int fa) {
  odd[u] = 0, even[u] = 1;
  for (auto &v : g[u])
    if (v != fa) {
      dfs1(v, u);
      dp[u] += dp[v] + even[v];
    }
  odd[fa] += even[u], even[fa] += odd[u];
}
void dfs2(int u, int fa) {
  if (fa != 0) {
    dp[u] += (dp[fa] - dp[u] - even[u]) + (even[fa] - odd[u]);
    even[u] += odd[fa] - even[u];
    odd[u] += even[fa] - odd[u];
  }
  for (auto &v : g[u])
    if (v != fa) dfs2(v, u);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[v].push_back(u);
    g[u].push_back(v);
  }
  dfs1(1, 0);
  dfs2(1, 0);
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans += dp[i];
  printf("%lld", ans / 2);
  return 0;
}
