#include <bits/stdc++.h>
struct node {
  long long v, next;
} edge[205000];
long long head[105000];
long long a[3];
long long count = 0;
long long visit[105000];
void add(long long u, long long v) {
  count++;
  edge[count].v = v;
  edge[count].next = head[u];
  head[u] = count;
}
void dfs(long long k, long long sign) {
  a[sign]++;
  long long i, v;
  for (i = head[k]; i != -1; i = edge[i].next) {
    v = edge[i].v;
    if (visit[v] == 0) {
      visit[v] = 1;
      dfs(v, sign ^ 1);
    }
  }
}
int main() {
  count = 0;
  long long n;
  long long i, x, y;
  memset(head, -1, sizeof(head));
  scanf("%lld", &n);
  for (i = 1; i < n; i++) {
    scanf("%lld %lld", &x, &y);
    add(x, y);
    add(y, x);
  }
  memset(visit, 0, sizeof(visit));
  visit[1] = 1;
  a[0] = 0;
  a[1] = 0;
  dfs(1, 0);
  long long ss = a[0] * a[1] - n + 1;
  printf("%lld\n", ss);
}
