#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> v[100001];
long long cnt[2] = {0};
void dfs(long long node, long long parent, bool b) {
  cnt[b]++;
  for (auto x : v[node]) {
    if (x == parent) continue;
    dfs(x, node, !b);
  }
}
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  dfs(1, 1, 0);
  cout << cnt[0] * cnt[1] - n + 1;
}
