#include <bits/stdc++.h>
using namespace std;
long long bin_pow(long long a, long long b) {
  if (b == 0) return 1;
  if (b % 2 == 0) {
    long long t = bin_pow(a, b / 2);
    return t * t % 100000000;
  } else
    return a * bin_pow(a, b - 1) % 100000000;
}
vector<long long> graph[200000], d(200000), cl(200000);
vector<pair<long long, long long> > edges;
long long used[200000], dl;
long long dfs(long long v, long long c) {
  used[v] = true;
  cl[v] = c;
  if (c == 0) dl++;
  d[v] = 1;
  for (auto u : graph[v]) {
    if (used[u]) continue;
    if (c == 0)
      d[v] += dfs(u, 1);
    else
      d[v] += dfs(u, 0);
  }
  return d[v];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t = 1, n, m, k = 0, sum = 0, l = 0, r = 0, x = 0, y = 0, z = 0,
            ans = 0, mn = LLONG_MAX, mx = LLONG_MIN;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> x >> y;
    x--, y--;
    graph[x].push_back(y), graph[y].push_back(x);
    edges.push_back({x, y});
  }
  dfs(0, 0);
  for (auto u : edges) {
    x = u.first, y = u.second;
    long long h = min(d[x], d[y]);
    ans += h * (n - h);
  }
  z = dl * (n - dl);
  cout << (ans + z) / 2;
  return 0;
}
