#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n;
int pos, head[N];
bool col[N], used[N];
long long ans;
struct Edge {
  int last, now;
} edge[N << 1];
void add(int a, int b) {
  edge[++pos].last = head[a];
  edge[pos].now = b;
  head[a] = pos;
}
void dfs(int a, int dep) {
  if (used[a]) return;
  used[a] = 1;
  if (dep & 1) col[a] = 1;
  for (int i = head[a]; i; i = edge[i].last) dfs(edge[i].now, dep ^ 1);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    add(u, v);
    add(v, u);
  }
  dfs(1, 1);
  long long ls = 0;
  for (int i = 1; i <= n; i++)
    if (col[i]) ls++;
  ans = ls * ((long long)n - ls) - ((long long)n - 1ll);
  printf("%lld\n", ans);
  return 0;
}
