#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, x, m, tmp, ans1, ans2, t;
int a[N], b[N], h[N];
string s, p;
map<string, int> pol;
vector<int> nei[N];
bool mark[N];
void read_input() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    nei[v].push_back(u);
    nei[u].push_back(v);
  }
}
void dfs(int v) {
  for (int i = 0; i < nei[v].size(); i++) {
    if (h[nei[v][i]] == 0) {
      h[nei[v][i]] = h[v] + 1;
      dfs(nei[v][i]);
    }
  }
}
void solve() {
  for (int i = 0; i < n; i++) (h[i] % 2) ? ans1++ : ans2++;
}
int main() {
  read_input();
  h[0] = 1;
  dfs(0);
  solve();
  cout << 1ll * ans1 * ans2 - n + 1;
  return 0;
}
