#include <bits/stdc++.h>
using namespace std;
template <class TH>
void _dbg(const char *sdbg, TH h) {
  cerr << sdbg << " = " << h << endl;
}
template <class TH, class... TA>
void _dbg(const char *sdbg, TH h, TA... a) {
  while (*sdbg != ',') cerr << *sdbg++;
  cerr << " = " << h << ", ";
  _dbg(sdbg + 1, a...);
}
const int maxn = (1e6) + 7;
const int maxk = 20;
const int inf = (1e9) + 7;
const long long LLinf = ((long long)1e18) + 7LL;
const long double eps = 1e-9;
const long long mod = 1e9 + 7;
vector<int> wek[maxn];
int deep[maxn];
int ile[10];
int r[maxn];
long long res = 0LL;
int n;
void dfs(int x, int f) {
  ile[deep[x] & 1]++;
  r[x] = 1;
  for (auto s : wek[x])
    if (s != f) {
      deep[s] = deep[x] + 1;
      dfs(s, x);
      r[x] += r[s];
    }
  if (x != 1) res += r[x] * (long long)(n - r[x]);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    wek[a].push_back(b);
    wek[b].push_back(a);
  }
  dfs(1, -1);
  res += ile[0] * (long long)ile[1];
  assert(res % 2 == 0);
  cout << res / 2LL;
  return 0;
}
