#include <bits/stdc++.h>
using namespace std;
long long int colour[100002];
void dfs(long long int s, vector<long long int> g[], bool vis[],
         long long int c) {
  vis[s] = true;
  colour[s] = c;
  for (long long int i = 0; i < g[s].size(); i++) {
    if (vis[g[s][i]] == false) {
      if (c)
        dfs(g[s][i], g, vis, 0);
      else
        dfs(g[s][i], g, vis, 1);
    }
  }
}
int main() {
  long long int n;
  cin >> n;
  long long int e = n - 1;
  vector<long long int> g[n + 1];
  bool vis[n + 1];
  for (long long int i = 1; i <= n; i++) vis[i] = false;
  for (long long int i = 1; i <= e; i++) {
    long long int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1, g, vis, 0);
  long long int one = 0, zero = 0;
  for (long long int i = 1; i <= n; i++) {
    if (colour[i] == 1)
      one++;
    else
      zero++;
  }
  cout << one * zero - (e);
  return 0;
}
