#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
int n, u, v, dp[maxn], d[maxn][2];
long long f[maxn], ans, sum;
vector<int> a[maxn];
void dfs(int nod, int pa) {
  for (int i : a[nod]) {
    if (i != pa) {
      dfs(i, nod);
      dp[nod] += dp[i];
      f[nod] += (f[i] + dp[i]);
    }
  }
  for (int i : a[nod]) {
    if (i != pa) {
      ans += (f[nod] - f[i] - dp[i]) * dp[i];
    }
  }
  ans += f[nod];
  dp[nod]++;
  return;
}
void anotherdfs(int nod, int pa) {
  for (int i : a[nod]) {
    if (i != pa) {
      anotherdfs(i, nod);
      sum += (1ll * d[i][1] * d[nod][1]);
      sum += (1ll * d[i][0] * d[nod][0]);
      d[nod][0] += d[i][1];
      d[nod][1] += d[i][0];
    }
  }
  sum += d[nod][1];
  d[nod][0]++;
  return;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    a[u].push_back(v);
    a[v].push_back(u);
  }
  dfs(1, 0);
  anotherdfs(1, 0);
  printf("%lld\n", (ans + sum) / 2);
}
