#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXN = 500000;
typedef struct Res {
  int cnt;
  bool canperfect, canperfectminroot;
  int cntperfectminother, cntperfectminrootminother;
} Res;
Res combine(const Res &a, const Res &b) {
  Res ret;
  ret.cnt = a.cnt + b.cnt - 1;
  ret.canperfect = a.canperfect && b.canperfectminroot ||
                   a.canperfectminroot && b.canperfect;
  ret.canperfectminroot = a.canperfectminroot && b.canperfectminroot;
  ret.cntperfectminother = (a.canperfect ? b.cntperfectminrootminother : 0) +
                           (a.canperfectminroot ? b.cntperfectminother : 0) +
                           (b.canperfect ? a.cntperfectminrootminother : 0) +
                           (b.canperfectminroot ? a.cntperfectminother : 0);
  ret.cntperfectminrootminother =
      (a.canperfectminroot ? b.cntperfectminrootminother : 0) +
      (b.canperfectminroot ? a.cntperfectminrootminother : 0);
  return ret;
}
Res extend(const Res &a) {
  Res ret;
  ret.cnt = a.cnt + 1;
  ret.canperfect = a.canperfectminroot;
  ret.canperfectminroot = a.canperfect;
  ret.cntperfectminother = a.cntperfectminrootminother;
  ret.cntperfectminrootminother =
      (a.canperfectminroot ? 1 : 0) + a.cntperfectminother;
  return ret;
}
Res single() {
  Res ret;
  ret.cnt = 1;
  ret.canperfect = false;
  ret.canperfectminroot = true;
  ret.cntperfectminother = 0;
  ret.cntperfectminrootminother = 0;
  return ret;
}
void print(const Res &a) {
  printf("[%d: %c %c %d %d]", a.cnt, a.canperfect ? 'V' : 'x',
         a.canperfectminroot ? 'V' : 'x', a.cntperfectminother,
         a.cntperfectminrootminother);
}
int n;
vector<int> adj[MAXN];
Res subtree[MAXN];
void dfs1(int at, int par) {
  subtree[at] = single();
  for (int i = (0); i < (((int)(adj[at]).size())); ++i) {
    int to = adj[at][i];
    if (to == par) continue;
    dfs1(to, at);
    subtree[at] = combine(subtree[at], extend(subtree[to]));
  }
}
long long dfs2(int at, int par, Res above) {
  vector<int> ch;
  for (int i = (0); i < (((int)(adj[at]).size())); ++i) {
    int to = adj[at][i];
    if (to != par) ch.push_back(to);
  }
  int nch = ((int)(ch).size());
  vector<Res> pref(nch + 1), suff(nch + 1);
  pref[0] = above;
  for (int i = (0); i < (nch); ++i)
    pref[i + 1] = combine(pref[i], extend(subtree[ch[i]]));
  suff[nch] = single();
  for (int i = nch - 1; i >= 0; --i)
    suff[i] = combine(extend(subtree[ch[i]]), suff[i + 1]);
  long long ret = 0;
  for (int i = (0); i < (nch); ++i) {
    int to = ch[i];
    Res a = combine(pref[i], suff[i + 1]), b = subtree[to];
    long long cur = 0;
    if (a.canperfect && b.canperfect)
      cur += (long long)a.cnt * b.cnt;
    else
      cur += (long long)((a.canperfectminroot ? 1 : 0) + a.cntperfectminother) *
             ((b.canperfectminroot ? 1 : 0) + b.cntperfectminother);
    ret += cur + dfs2(to, at, extend(a));
  }
  return ret;
}
void run() {
  scanf("%d", &n);
  for (int i = (0); i < (n - 1); ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    --a, --b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dfs1(0, -1);
  long long ret = dfs2(0, -1, single());
  printf("%lld\n", ret);
}
int main() {
  run();
  return 0;
}
