#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e8;
const double pi = 3.1415926535897;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
struct edge {
  int from, to, w;
  edge(int u, int v, int w) : from(u), to(v), w(w) {}
  bool operator<(const edge &e) const { return w > e.w; }
};
const int N = 100005;
int col[N];
int cnt[2];
vector<int> adj[N];
void dfs(int nd, int par, int mark) {
  col[nd] = mark;
  cnt[mark]++;
  for (auto ch : adj[nd]) {
    if (ch == par) continue;
    dfs(ch, nd, mark ^ 1);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, u, v;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(0, 0, 0);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    int curr = cnt[col[i] ^ 1];
    curr -= ((int)((adj[i]).size()));
    ans += (long long)curr;
  }
  cout << ans / 2LL;
}
