#include <bits/stdc++.h>
using namespace std;
int sz[1010100], n, h[1010100];
long long Down[1010100], Up[1010100];
vector<int> e[1010100];
void dfsDown(int u, int p) {
  sz[u] = 1;
  for (int v : e[u])
    if (v != p) {
      h[v] = h[u] + 1;
      dfsDown(v, u);
      sz[u] += sz[v];
      Down[u] += Down[v] + sz[v];
    }
}
void dfsUp(int u, int p) {
  long long sum = 0;
  for (int v : e[u])
    if (v != p) {
      sum += Down[v];
    }
  for (int v : e[u])
    if (v != p) {
      Up[v] = sum - Down[v] + Up[u] + n - sz[v] + (sz[u] - sz[v] - 1);
      dfsUp(v, u);
    }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = (2); i <= (n); ++i) {
    int u, v;
    cin >> u >> v;
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfsDown(1, -1);
  dfsUp(1, -1);
  long long ans = 0;
  for (int u = (1); u <= (n); ++u) ans += Up[u] + Down[u];
  { cerr << "ans" << '=' << ans << '\n'; };
  ans /= 2;
  long long cntOdd = 0;
  for (int u = (1); u <= (n); ++u)
    if (h[u] % 2) {
      cntOdd++;
    }
  cntOdd = (cntOdd) * (n - cntOdd);
  ans += cntOdd;
  ans /= 2;
  cout << ans;
}
