#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > g;
vector<int> color;
void DFS(int v, int clr) {
  color[v] = clr ^ 1;
  for (int u : g[v]) {
    if (color[u] == -1) {
      DFS(u, color[v]);
    }
  }
}
int main() {
  int n;
  cin >> n;
  g.assign(n + 1, vector<int>());
  color.assign(n + 1, -1);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  DFS(1, 0);
  int a = 0, b = 0;
  for (int i = 1; i <= n; i++) {
    if (color[i] == 0) a++;
    if (color[i] == 1) b++;
  }
  long long ans = (long long)a * b;
  cout << (ans) - (n - 1);
  return 0;
}
