#include <bits/stdc++.h>
using namespace std;
const int N = 1000;
const double eps = 1e-9;
long long INF = 1e9 + 7;
struct ord {
  bool operator()(pair<int, int> a, pair<int, int> b) {
    if (a.first == b.first) {
      return (a.second < b.second);
    } else
      return (a.first > b.first);
  }
};
struct compare {
  bool operator()(const int& l, const int& r) { return l > r; }
};
void read(string str, int node) {
  stringstream ss;
  int number;
  ss << str;
  while (ss >> number) cout << number << endl;
}
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
long long fp(long long b, long long p) {
  if (p == 0) return 1;
  if (p % 2 == 0) return fp((b * b) % INF, p / 2);
  return (fp(b, p - 1) * b) % INF;
}
long long read_binary(string s) {
  unsigned long long x = 0, tmp = 1;
  for (int i = s.size() - 1; i >= 0; i--) {
    x = (x + tmp * (s[i] - '0')) % INF;
    tmp = (tmp * 2) % INF;
  }
  return x;
}
vector<vector<int>> adj;
int main() {
  long long n;
  scanf("%lld", &n);
  adj.resize(n + 2, vector<int>());
  bool isb = 1;
  queue<long long> q;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  q.push(1);
  vector<long long> color(n + 3, INF);
  color[1] = 0;
  long long z = 1, o = 0;
  while (!q.empty() && isb) {
    int u = q.front();
    q.pop();
    for (int i = 0; i < adj[u].size(); i++) {
      int ch = adj[u][i];
      if (color[ch] == INF) {
        color[ch] = 1 - color[u];
        q.push(ch);
        if (color[ch] == 0)
          z++;
        else
          o++;
      } else if (color[ch] == color[u]) {
        isb = 0;
        break;
      }
    }
  }
  if (!isb) return cout << 0 << endl, 0;
  unsigned long long res = z * o;
  res -= (n - 1);
  cout << res << endl;
}
