#include <bits/stdc++.h>
using namespace std;
long long n;
long long u, v;
vector<long long> f[100001];
long long Chan(0), Le(0);
bool flag[100001];
void DFS(long long x, long long Bac) {
  flag[x] = false;
  if (Bac % 2 == 0)
    Chan++;
  else
    Le++;
  for (int i = 0; i < f[x].size(); i++) {
    if (flag[f[x][i]]) DFS(f[x][i], Bac + 1);
  }
}
void Solve() {
  DFS(1, 1);
  cout << Chan * Le - n + 1;
}
void Enter() {
  fill_n(&flag[0], sizeof(flag) / sizeof(flag[0]), true);
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    f[u].push_back(v);
    f[v].push_back(u);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  Enter();
  Solve();
}
