#include <bits/stdc++.h>
using namespace std;
int read() {
  char ch;
  for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    ;
  int x = ch - '0';
  for (ch = getchar(); ch >= '0' && ch <= '9'; ch = getchar())
    x = x * 10 + ch - '0';
  return x;
}
const int N = 1e6 + 5;
int t[N << 1], nxt[N << 1], lst[N], l;
void add(int x, int y) {
  t[++l] = y;
  nxt[l] = lst[x];
  lst[x] = l;
}
int n, x, y, size[N], a[N], L[N], R[N], tot;
struct Dp {
  int a[2][2];
  Dp trans() {
    Dp x;
    x.a[0][0] = a[1][0];
    x.a[0][1] = a[0][0] + a[1][1];
    x.a[1][0] = a[0][0];
    x.a[1][1] = a[0][1];
    return x;
  }
  friend Dp operator+(Dp x, Dp y) {
    Dp z;
    memset(z.a, 0, sizeof(z.a));
    for (int i = 0; i <= 1; i++)
      for (int j = 0; j <= 1; j++)
        for (int k = 0; k <= 1 - i; k++)
          for (int l = 0; l <= 1 - j; l++)
            z.a[i + k][j + l] += x.a[i][j] * y.a[k][l];
    return z;
  }
} f[N], g[N], pre[N], Null;
void dfs(int x, int y) {
  for (int i = lst[x]; i; i = nxt[i])
    if (t[i] != y) dfs(t[i], x);
  f[x] = Null;
  size[x] = 1;
  for (int i = lst[x]; i; i = nxt[i])
    if (t[i] != y) {
      size[x] += size[t[i]];
      f[x] = f[x] + f[t[i]].trans();
    }
}
void dp(int x, int y) {
  L[x] = ++tot;
  for (int i = lst[x]; i; i = nxt[i])
    if (t[i] != y) a[++tot] = t[i];
  R[x] = tot;
  pre[L[x]] = y ? g[x].trans() : Null;
  for (int i = L[x] + 1; i <= R[x]; i++) pre[i] = pre[i - 1] + f[a[i]].trans();
  Dp now = Null;
  for (int i = R[x]; i >= L[x] + 1; i--) {
    g[a[i]] = pre[i - 1] + now;
    now = now + f[a[i]].trans();
  }
  for (int i = L[x] + 1; i <= R[x]; i++) dp(a[i], x);
}
int main() {
  n = read();
  for (int i = 1; i <= n - 1; i++) {
    x = read();
    y = read();
    add(x, y);
    add(y, x);
  }
  Null.a[0][0] = 1;
  dfs(1, 0);
  dp(1, 0);
  long long ans = 0;
  for (int i = 2; i <= n; i++)
    if (f[i].a[1][0] == 1 && g[i].a[1][0] == 1)
      ans += (long long)size[i] * (n - size[i]);
    else
      ans += (long long)(f[i].a[0][0] + f[i].a[1][1]) *
             (g[i].a[0][0] + g[i].a[1][1]);
  printf("%I64d\n", ans);
  return 0;
}
