#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
long long zero = 0, one = 0, visited[1000001] = {0}, c[1000001] = {0};
vector<long long> v[100001];
bool dfs(long long root, long long color) {
  visited[root] = 1;
  c[root] = color;
  if (c[root] == 1)
    one++;
  else
    zero++;
  for (auto x : v[root]) {
    if (visited[x] == 0) {
      if (dfs(x, color ^ 1) == false) return false;
    } else if (visited[x] == 1) {
      if (c[x] == c[root]) return false;
    }
  }
  return true;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, i;
  cin >> n;
  for (i = 0; i < n - 1; i++) {
    long long x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  bool flag = dfs(1, 0);
  if (flag == true) {
    cout << one * zero - (n - 1) << endl;
  }
}
