#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 7;
vector<int> G[MAXN];
int du[MAXN];
int cnt[MAXN], getAns[MAXN];
void dfs(int u, int deep, int pre) {
  cnt[deep & 1]++;
  int len = G[u].size();
  for (int i = 0; i < len; ++i) {
    int v = G[u][i];
    if (v == pre) continue;
    dfs(v, deep + 1, u);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(1, 0, -1);
  long long res = 0;
  res = (long long)cnt[0] * cnt[1];
  res -= (n - 1);
  printf("%lld\n", res);
}
