#include <bits/stdc++.h>
#pragma GCC optimize("O2")
const int inf = 0x3fffffff;
const int maxn = 2017;
const int mod = 1000000007;
using namespace std;
inline int read() {
  int f = 1, x = 0;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return f * x;
}
struct tsdl {
  int w, to, next;
} edge[100001 * 4];
int head[100001], cnt[100001], tot, vis[100001];
void add(int ui, int vi) {
  edge[tot].next = head[ui];
  edge[tot].to = vi;
  head[ui] = tot++;
}
void dfs(int x, int side) {
  cnt[side]++;
  vis[x] = 1;
  for (int i = head[x]; i != -1; i = edge[i].next) {
    int v = edge[i].to;
    if (!vis[v]) {
      vis[v] = 1;
      dfs(v, side ^ 1);
    }
  }
}
int main() {
  memset(head, -1, sizeof head);
  int n = read();
  for (int i = 1; i < n; i++) {
    int a = read(), b = read();
    add(a, b);
    add(b, a);
  }
  dfs(1, 0);
  cout << (long long)cnt[0] * cnt[1] - (n - 1) << endl;
}
