#include <bits/stdc++.h>
using namespace std;
struct centroid_descomposition {
  int n;
  vector<bool> del;
  vector<vector<int>> adj;
  vector<int> size, parent;
  centroid_descomposition(int n) : n(n), del(n), adj(n), size(n), parent(n){};
  void add_edge(int u, int v) {
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  int centroid(int u) {
    vector<int> seen = {u};
    parent[u] = -1;
    for (size_t i = 0; i < seen.size(); ++i) {
      u = seen[i];
      for (int v : adj[u])
        if (!del[v] && v != parent[u]) parent[v] = u, seen.push_back(v);
    }
    for (int sz = seen.size(), i = sz - 1, mx = 0; i >= 0; --i, mx = 0) {
      size[u = seen[i]] = 1;
      for (int v : adj[u])
        if (!del[v] && v != parent[u])
          size[u] += size[v], mx = max(mx, size[v]);
      if (max(sz - size[u], mx) <= sz / 2) return u;
    }
    return -1;
  }
  void dfs(int u, int p, int d, vector<long long> &dist,
           vector<long long> &cnt) {
    dist.push_back(d);
    cnt[d & 1]++;
    for (int v : adj[u])
      if (!del[v] && v != p) dfs(v, u, d + 1, dist, cnt);
  }
  long long rootify(int r) {
    int c = centroid(r);
    assert(c != -1);
    del[c] = true;
    long long ans = 0, dist = 0, sz = 0;
    vector<long long> cnt(2);
    for (int v : adj[c])
      if (!del[v]) {
        vector<long long> t(2), d;
        dfs(v, c, 1, d, t);
        for (auto x : d) ans += dist + (sz + 1) * x;
        for (auto x : d) dist += x, ++sz;
        ans += t[0] * cnt[1] + t[1] * cnt[0] + t[1];
        cnt[0] += t[0];
        cnt[1] += t[1];
      }
    for (int v : adj[c])
      if (!del[v]) ans += rootify(v);
    return ans;
  }
};
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  centroid_descomposition cd(n);
  for (int i = 1, u, v; i < n; ++i) {
    cin >> u >> v;
    cd.add_edge(--u, --v);
  }
  cout << cd.rootify(0) / 2 << "\n";
  return 0;
}
