#include <bits/stdc++.h>
using namespace std;
const int MAX_N = (int)2e5 + 7;
long long dp[MAX_N];
long long num[MAX_N][2];
long long dist[MAX_N][2];
vector<int> a[MAX_N];
long long ans = 0;
void go(int v, int pr = -1) {
  ++num[v][0];
  for (int to : a[v]) {
    if (to == pr) continue;
    go(to, v);
    for (int i = 0; i < 2; ++i)
      for (int j = 0; j < 2; ++j) {
        ans += dist[v][i] * num[to][j] + dist[to][j] * num[v][i];
        if (!i && !j) {
          ans += num[to][j] * num[v][i];
        }
      }
    num[v][0] += num[to][1];
    dist[v][0] += dist[to][1];
    num[v][1] += num[to][0];
    dist[v][1] += dist[to][0] + num[to][0];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  go(0);
  cout << ans << "\n";
}
