#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  return (b) == 0 ? (a) : gcd((b), ((a) % (b)));
}
template <class T>
inline T lcm(T a, T b) {
  return ((a) / gcd((a), (b)) * (b));
}
template <class T>
inline T BigMod(T Base, T power, T M = 1000000007) {
  if (power == 0) return 1;
  if (power & 1)
    return ((Base % M) * (BigMod(Base, power - 1, M) % M)) % M;
  else {
    T y = BigMod(Base, power / 2, M) % M;
    return (y * y) % M;
  }
}
template <class T>
inline T ModInv(T A, T M = 1000000007) {
  return BigMod(A, M - 2, M);
}
int fx[] = {-1, +0, +1, +0, +1, +1, -1, -1, +0};
int fy[] = {+0, -1, +0, +1, +1, -1, +1, -1, +0};
int day[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
long long odd[500005], even[500005];
long long ans;
vector<int> v[500005];
long long childo[500005], childe[500005];
void dfs(int s, int p) {
  for (auto it : v[s]) {
    if (it == p) continue;
    dfs(it, s);
    even[s] += odd[it];
    odd[s] += even[it] + childe[it] + 1;
    childe[s] += childo[it];
    childo[s] += 1 + childe[it];
  }
}
void dfs2(int s, int p = 0) {
  if (s != 1) {
    long long ee = even[p] - odd[s];
    long long oo = odd[p] - even[s] - childe[s] - 1;
    long long ce = childe[p] - childo[s];
    long long co = childo[p] - 1 - childe[s];
    even[s] += oo;
    odd[s] += ee + ce + 1;
    childe[s] += co;
    childo[s] += 1 + ce;
  }
  ans += even[s] + odd[s];
  for (auto it : v[s]) {
    if (it == p) continue;
    dfs2(it, s);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  dfs(1, 0);
  dfs2(1, 0);
  cout << (ans >> 1ll) << endl;
  return 0;
}
