#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 10;
int n, color[MAXN];
vector<int> adj[MAXN];
void Dfs(int prevv, int u) {
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v == prevv) continue;
    color[v] = 3 - color[u];
    Dfs(u, v);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  color[1] = 1;
  Dfs(0, 1);
  long long lef = 0, rig = 0;
  for (int i = 1; i <= n; i++)
    if (color[i] == 1) lef++;
  rig = n - lef;
  cout << (1LL * rig * lef - (n - 1));
  return 0;
}
