#include <bits/stdc++.h>
bool isPrime(long long N) {
  for (long long i = 2; i * i <= N; ++i) {
    if (N % i == 0) return false;
  }
  return true;
}
using namespace std;
vector<long long> g[100005];
long long color[2];
void dfs(long long n, long long np, long long c) {
  color[c]++;
  for (long long i = 0; i < g[n].size(); i++) {
    if (g[n][i] != np) {
      dfs(g[n][i], n, !c);
    }
  }
}
int main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    long long x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1, 0, 0);
  cout << color[0] * color[1] - (n - 1) << endl;
}
