#include <bits/stdc++.h>
using namespace std;
void getint(int &v) {
  char ch, fu = 0;
  for (ch = '*'; (ch < '0' || ch > '9') && ch != '-'; ch = getchar())
    ;
  if (ch == '-') fu = 1, ch = getchar();
  for (v = 0; ch >= '0' && ch <= '9'; ch = getchar()) v = v * 10 + ch - '0';
  if (fu) v = -v;
}
pair<int, long long> f[500010][2];
long long ans;
int nedge, n, x, y, nxt[500010], hed[500010], too[500010], siz[500010];
void ae(int x, int y) {
  nxt[++nedge] = hed[x];
  hed[x] = nedge;
  too[nedge] = y;
}
void dfs(int x, int l) {
  siz[x] = 1;
  f[x][0] = make_pair(1, 0);
  for (int i = hed[x]; i; i = nxt[i]) {
    int y = too[i];
    if (y == l) continue;
    siz[x] += siz[y];
    dfs(y, x);
  }
  for (int i = hed[x]; i; i = nxt[i]) {
    int y = too[i];
    if (y == l) continue;
    pair<int, long long> A =
        make_pair(f[y][0].first, f[y][0].second + f[y][0].first);
    pair<int, long long> B =
        make_pair(f[y][1].first, f[y][1].second + f[y][1].first);
    ans += (1ll * (A.second + A.first) * f[x][0].first +
            1ll * f[x][0].second * A.first) /
           2;
    ans +=
        (1ll * A.second * f[x][1].first + 1ll * f[x][1].second * A.first) / 2;
    ans +=
        (1ll * B.second * f[x][0].first + 1ll * f[x][0].second * B.first) / 2;
    ans += (1ll * B.second * f[x][1].first +
            1ll * (f[x][1].second + f[x][1].first) * B.first) /
           2;
    f[x][0].first += B.first;
    f[x][0].second += B.second;
    f[x][1].first += A.first;
    f[x][1].second += A.second;
  }
}
int main() {
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    getint(x), getint(y);
    ae(x, y), ae(y, x);
  }
  dfs(1, 0);
  cout << ans << endl;
  return 0;
}
