#include <bits/stdc++.h>
using namespace std;
const int INF = 2e9 + 3;
const int N = 1e5 + 3;
const int MOD = 998244353;
const double EPS = 1e-9;
const double PI = acos(-1);
int cnt[2];
int color[N];
vector<char> used(N, 0);
vector<int> gr[N];
void dfs(int cur, int col) {
  used[cur] = 1;
  color[cur] = col;
  cnt[col]++;
  for (int v : gr[cur]) {
    if (!used[v]) dfs(v, 1 - col);
  }
}
void solve() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    gr[a].push_back(b);
    gr[b].push_back(a);
  }
  for (int v = 1; v <= n; v++) {
    if (!used[v]) dfs(v, 0);
  }
  cout << 1ll * cnt[0] * cnt[1] - n + 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
