#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100005;
vector<int> G[MAX_N];
int color[MAX_N];
long long int x, y, z;
void dfs(int i, int c) {
  color[i] = c;
  if (c == 1) {
    ++x;
  } else {
    ++y;
  }
  for (int k = 0; k < G[i].size(); ++k) {
    int j = G[i][k];
    if (color[j] == 0) {
      dfs(j, -c);
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  x = 0;
  y = 0;
  z = 0;
  memset(color, 0, sizeof(color));
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
    ++z;
  }
  dfs(1, 1);
  printf("%lld\n", x * y - z);
}
