#include <bits/stdc++.h>
using namespace std;
const double M = pow(2, 32);
const long long int modinv = 5 * (pow(10, 8)) + 4;
struct Compare {
  constexpr bool operator()(pair<int, int> const& a,
                            pair<int, int> const& b) const noexcept {
    return (a.first > b.first) || (a.first == b.first && a.second > b.second);
  }
};
vector<int> adj[100001];
vector<bool> vis;
int main() {
  long long int n;
  cin >> n;
  vis.resize(n, false);
  for (long long int i = 0; i < n; i++) adj[i].clear();
  for (long long int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  long long int zeros = 1;
  long long int ones = 0;
  vis[0] = true;
  queue<pair<int, bool>> q;
  q.push({0, false});
  while (!q.empty()) {
    int u = q.front().first;
    bool flag = q.front().second;
    q.pop();
    for (auto x : adj[u]) {
      if (!vis[x]) {
        if (flag) {
          zeros++;
          q.push({x, false});
        } else {
          ones++;
          q.push({x, true});
        }
        vis[x] = true;
      }
    }
  }
  long long int ans = zeros * ones - (n - 1);
  cout << ans << endl;
}
