#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const long long ooo = 9223372036854775807ll;
const int _cnt = 1000 * 1000 + 7;
const int _p = 1000 * 1000 * 1000 + 7;
const int N = 500105;
const double PI = acos(-1.0);
const double eps = 1e-6;
int o(int x) { return x % _p; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
void file_put() {
  freopen("filename.in", "r", stdin);
  freopen("filename.out", "w", stdout);
}
long long ans = 0, dp[N][8];
int head[N], e[N << 1], nxt[N << 1], n, tot = 0, c[N], x, y;
bool flag = 0;
void I(int x, int y) { e[++tot] = y, nxt[tot] = head[x], head[x] = tot; }
void merge(int x, int y) {
  memset(dp[0], 0, sizeof(dp[0]));
  dp[0][7] += dp[x][2] * dp[y][4];
  dp[0][6] += dp[x][2] * dp[y][5];
  dp[0][7] += dp[x][3] * dp[y][5];
  dp[0][1] += dp[x][0] * dp[y][0];
  dp[0][0] += dp[x][0] * dp[y][1];
  dp[0][1] += dp[x][1] * dp[y][1];
  dp[0][3] += dp[x][0] * dp[y][2];
  dp[0][2] += dp[x][0] * dp[y][3];
  dp[0][3] += dp[x][1] * dp[y][3];
  dp[0][5] += dp[x][0] * dp[y][4];
  dp[0][4] += dp[x][0] * dp[y][5];
  dp[0][5] += dp[x][1] * dp[y][5];
  dp[0][7] += dp[x][0] * dp[y][6];
  dp[0][6] += dp[x][0] * dp[y][7];
  dp[0][7] += dp[x][1] * dp[y][7];
  dp[0][7] += dp[y][2] * dp[x][4];
  dp[0][6] += dp[y][3] * dp[x][4];
  dp[0][7] += dp[y][3] * dp[x][5];
  dp[0][3] += dp[y][0] * dp[x][2];
  dp[0][2] += dp[y][1] * dp[x][2];
  dp[0][3] += dp[y][1] * dp[x][3];
  dp[0][5] += dp[y][0] * dp[x][4];
  dp[0][4] += dp[y][1] * dp[x][4];
  dp[0][5] += dp[y][1] * dp[x][5];
  dp[0][7] += dp[y][0] * dp[x][6];
  dp[0][6] += dp[y][1] * dp[x][6];
  dp[0][7] += dp[y][1] * dp[x][7];
  swap(dp[0], dp[x]);
}
bool dfs0(int x, int f) {
  for (int i = head[x]; i; i = nxt[i]) {
    if (e[i] == f) continue;
    if (!dfs0(e[i], x) || c[x] && !c[e[i]]) return 0;
    if (!c[x] && !c[e[i]]) c[x] = 1;
  }
  return 1;
}
int dfs(int x, int f) {
  int sz = 1;
  dp[x][0] = dp[x][3] = 1;
  for (int i = head[x]; i; i = nxt[i]) {
    if (e[i] == f) continue;
    sz += dfs(e[i], x);
    merge(x, e[i]);
  }
  if (!((sz)&1) && flag) ans += (long long)sz * (n - sz);
  dp[x][5] += dp[x][3];
  return sz;
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n - 1); ++i) scanf("%d%d", &x, &y), I(x, y), I(y, x);
  if (!((n)&1)) flag = dfs0(1, 0);
  dfs(1, 0);
  printf("%I64d\n", dp[1][7] + ans);
  return 0;
}
