#include <bits/stdc++.h>
using namespace std;
const double Pi = acos(-1.0);
class dfstream {
 public:
  dfstream& operator<<(int n) {
    cout << n;
    return *this;
  }
  dfstream& operator<<(long long n) {
    cout << n;
    return *this;
  }
  dfstream& operator<<(string s) {
    cout << s;
    return *this;
  }
  dfstream& operator<<(char s[]) {
    cout << s;
    return *this;
  }
  dfstream& operator<<(double n) {
    cout << n;
    return *this;
  }
  dfstream& operator<<(vector<int> n) {
    for (auto i : n) {
      cout << i << " ";
    }
    return *this;
  }
  dfstream& operator<<(vector<long long> n) {
    for (auto i : n) {
      cout << i << " ";
    }
    return *this;
  }
  dfstream& operator<<(vector<double> n) {
    for (auto i : n) {
      cout << i << " ";
    }
    return *this;
  }
  dfstream& operator<<(set<int> n) {
    for (auto i : n) {
      cout << i << " ";
    }
    return *this;
  }
  dfstream& operator<<(set<long long> n) {
    for (auto i : n) {
      cout << i << " ";
    }
    return *this;
  }
  dfstream& operator<<(set<double> n) {
    for (auto i : n) {
      cout << i << " ";
    }
    return *this;
  }
} dout;
void DEBUG(string name, int* begin, int* end) {
  printf("DEBUG: %s = {", name.c_str());
  for (; begin != end; begin++) {
    printf("%5d,", *begin);
  }
  printf("%c}\n", (char)8);
}
void DEBUG(string name, long long* begin, long long* end) {
  printf("DEBUG: %s = {", name.c_str());
  for (; begin != end; begin++) {
    printf("%5lld,", *begin);
  }
  printf("%c}\n", (char)8);
}
void DEBUG(string name, double* begin, double* end) {
  printf("DEBUG: %s = {", name.c_str());
  for (; begin != end; begin++) {
    printf("%5lf,", *begin);
  }
  printf("%c}\n", (char)8);
}
void DEBUG(string name, vector<int> nums) {
  printf("DEBUG: %s = {", name.c_str());
  for (int i : nums) {
    printf("%5d,", i);
  }
  printf("%c}\n", (char)8);
}
void DEBUG(string name, set<int> nums) {
  printf("DEBUG: %s = {", name.c_str());
  for (int i : nums) {
    printf("%5d,", i);
  }
  printf("%c}\n", (char)8);
}
void DEBUG(string name, vector<long long> nums) {
  printf("DEBUG: %s = {", name.c_str());
  for (long long i : nums) {
    printf("%5lld,", i);
  }
  printf("%c}\n", (char)8);
}
void DEBUG(string name, set<long long> nums) {
  printf("DEBUG: %s = {", name.c_str());
  for (long long i : nums) {
    printf("%5lld,", i);
  }
  printf("%c}\n", (char)8);
}
void DEBUG(string name, map<int, int> nums) {
  printf("DEBUG: %s = {", name.c_str());
  for (auto i : nums) {
    printf("(%d -> %d),", i.first, i.second);
  }
  printf("%c}\n", (char)8);
}
void DEBUG(string name, queue<int> nums) {
  if (nums.size() == 0) {
    printf("DEBUG: %s = []\n", name.c_str());
    return;
  }
  printf("DEBUG: %s = [", name.c_str());
  while (!nums.empty()) {
    printf("%5d,", nums.front());
    nums.pop();
  }
  printf("%c]\n", (char)8);
}
void DEBUG(string name, int num) {
  printf("DEBUG: %s = %d\n", name.c_str(), num);
}
void DEBUG(string name, long long num) {
  printf("DEBUG: %s = %lld\n", name.c_str(), num);
}
void DEBUG(string name, double num) {
  printf("DEBUG: %s = %lf\n", name.c_str(), num);
}
int n;
vector<int> adj[200010];
int parent[200010];
bool visited[200010];
int depths[200010];
long long cnt[200010][2];
void dfs1(int node) {
  cnt[node][0]++;
  for (int i : adj[node]) {
    if (!visited[i]) {
      visited[i] = true;
      parent[i] = node;
      depths[i] = depths[node] + 1;
      dfs1(i);
      cnt[node][0] += cnt[i][1];
      cnt[node][1] += cnt[i][0];
    }
  }
}
long long ans;
void dfs2(int node, long long currsum) {
  ans += (currsum + cnt[0][1 - (depths[node] % 2)]) / 2;
  for (int i : adj[node]) {
    if (i == parent[node]) continue;
    dfs2(i, currsum + n - 2 * (cnt[i][0] + cnt[i][1]));
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  visited[0] = true;
  dfs1(0);
  long long sum0 = 0;
  for (int i = 0; i < n; i++) {
    sum0 += depths[i];
  }
  dfs2(0, sum0);
  cout << ans / 2 << '\n';
  return 0;
}
