#include <bits/stdc++.h>
using namespace std;
vector<long long int> gp[1000009], in;
long long int n, c = 0, d = 0;
void dfs(long long int a, long long int rt) {
  in[a] = in[rt] + 1;
  (in[a] % 2) ? c++ : d++;
  for (long long int val : gp[a]) {
    if (val == rt || in[val] != -1) continue;
    dfs(val, a);
  }
  return;
}
void solve() {
  long long int a, b;
  cin >> n;
  in.resize(n + 2, -1);
  for (long long int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    gp[a].push_back(b), gp[b].push_back(a);
  }
  dfs(1, 0);
  cout << (c * d - (n - 1));
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
