#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000001;
const long double EPS = 1e-9;
const int MOD = 1000000007;
const long long LLINF = 1000000000000000001;
const int maxn = 200042;
vector<int> gr[maxn];
long long cnt[maxn];
long long pcnt[maxn][2];
long long dist[maxn];
int n;
long long ans;
long long npair;
void dfs(int a, int o) {
  for (auto i : gr[a])
    if (i != o) {
      dfs(i, a);
      cnt[a] += cnt[i];
      for (int j = 0; j <= 1; j++) pcnt[a][j] += pcnt[i][j ^ 1];
      dist[a] += dist[i];
    }
  ans += dist[a];
  npair += pcnt[a][0];
  for (auto i : gr[a])
    if (i != o) {
      ans += dist[i] * (cnt[a] - cnt[i]);
      npair += pcnt[i][0] * (pcnt[a][0] - pcnt[i][1]);
    }
  cnt[a]++;
  pcnt[a][1]++;
  dist[a] += cnt[a];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    cin >> a >> b;
    gr[a].push_back(b);
    gr[b].push_back(a);
  }
  dfs(1, -1);
  ans = (ans / 2) + (npair / 2) + (npair % 2);
  cout << ans << '\n';
}
