#include <bits/stdc++.h>
using namespace std;
const long long INF = 2147483647;
const long long MOD = 1000000007;
const long long mod = 998244353;
long long n;
vector<long long> edge[200001];
bool tag[200001];
long long ccnt[200001][2];
long long Tcnt[2];
long long dp[200001];
long long res;
void Tag(long long v, long long pv, long long dep) {
  tag[v] = dep;
  for (long long i : edge[v]) {
    if (i == pv) continue;
    Tag(i, v, 1 - dep);
  }
}
void dfs(long long v, long long pv) {
  ccnt[v][tag[v]] = 1;
  dp[v] = 0;
  for (long long i : edge[v]) {
    if (i == pv) continue;
    dfs(i, v);
    ccnt[v][0] += ccnt[i][0];
    ccnt[v][1] += ccnt[i][1];
    dp[v] += dp[i] + ccnt[i][tag[i]];
  }
}
void DP(long long v, long long pv) {
  for (long long i : edge[v]) {
    if (i == pv) continue;
    dp[i] = dp[v] + (Tcnt[tag[v]] - ccnt[i][tag[v]]) - ccnt[i][tag[i]];
    DP(i, v);
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long v1, v2;
  cin >> n;
  for (long long i = (0); i <= (n - 2); i += (1)) {
    cin >> v1 >> v2;
    v1--;
    v2--;
    edge[v1].push_back(v2);
    edge[v2].push_back(v1);
  }
  Tag(0, -1, 0);
  dfs(0, -1);
  Tcnt[0] = ccnt[0][0];
  Tcnt[1] = ccnt[0][1];
  DP(0, -1);
  for (long long i = (0); i <= (n - 1); i += (1)) {
    res += dp[i];
  }
  res /= 2;
  cout << res << endl;
  return 0;
}
