#include <bits/stdc++.h>
using namespace std;
long long n, m;
vector<long long> g[100005];
priority_queue<long long> q;
vector<long long> ans;
long long col = 1;
long long l = 0;
long long r = 0;
void dfs(long long v, long long p, bool col) {
  if (col)
    r++;
  else
    l++;
  for (long long i = 0; i < g[v].size(); i++) {
    if (g[v][i] != p) dfs(g[v][i], v, !col);
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, -1, 0);
  cout << l * r - n + 1;
}
