#include <bits/stdc++.h>
using namespace std;
int inline read() {
  int num = 0, neg = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') neg = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    num = (num << 3) + (num << 1) + c - '0';
    c = getchar();
  }
  return num * neg;
}
const int maxn = 500010;
int n, sz[maxn];
vector<int> G[maxn];
struct Node {
  int a[2][2];
} f[maxn], g[maxn];
long long ans;
Node init() {
  Node z;
  z.a[0][0] = 1;
  z.a[0][1] = z.a[1][0] = z.a[1][1] = 0;
  return z;
}
Node trans(Node x, Node y) {
  Node z;
  z.a[0][0] = x.a[0][0] * y.a[1][0];
  z.a[1][0] = x.a[0][0] * y.a[0][0] + x.a[1][0] * y.a[1][0];
  z.a[0][1] = x.a[0][0] * (y.a[0][0] + y.a[1][1]) + x.a[0][1] * y.a[1][0];
  z.a[1][1] = x.a[0][0] * y.a[0][1] + x.a[0][1] * y.a[0][0] +
              x.a[1][0] * (y.a[0][0] + y.a[1][1]) + x.a[1][1] * y.a[1][0];
  return z;
}
void print(Node x) {
  cout << x.a[0][0] << " " << x.a[0][1] << " " << x.a[1][0] << " " << x.a[1][1]
       << endl;
}
Node merge(Node x, Node y) {
  Node z;
  z.a[0][0] = x.a[0][0] * y.a[0][0];
  z.a[1][0] = x.a[1][0] * y.a[0][0] + x.a[0][0] * y.a[1][0];
  z.a[0][1] = x.a[0][0] * y.a[0][1] + x.a[0][1] * y.a[0][0];
  z.a[1][1] = x.a[0][0] * y.a[1][1] + x.a[0][1] * y.a[1][0] +
              x.a[1][0] * y.a[0][1] + x.a[1][1] * y.a[0][0];
  return z;
}
vector<int>::iterator it;
void dfs(int x, int fa) {
  f[x] = init();
  sz[x] = 1;
  for (int i = 0; i < G[x].size(); i++) {
    int v = G[x][i];
    if (v == fa) continue;
    dfs(v, x);
    sz[x] += sz[v];
    f[x] = trans(f[x], f[v]);
  }
  if (x != 1) it = find(G[x].begin(), G[x].end(), fa), G[x].erase(it);
}
vector<Node> sum[maxn];
void dfs1(int x, int fa) {
  Node s = init();
  if (fa)
    s = trans(s, g[x]), sum[x].push_back(s);
  else
    sum[x].push_back(s);
  for (int i = 0; i < G[x].size(); i++) {
    int v = G[x][i];
    s = trans(s, f[v]);
    sum[x].push_back(s);
  }
  Node t = init();
  for (int i = G[x].size() - 1; i >= 0; i--) {
    int v = G[x][i];
    g[v] = merge(sum[x][i], t);
    t = trans(t, f[v]);
    dfs1(v, x);
  }
}
int main() {
  n = read();
  if (n & 1) {
    cout << 0;
    return 0;
  }
  for (int i = 1; i < n; i++) {
    int u = read(), v = read();
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1, 0);
  dfs1(1, 0);
  for (int i = 2; i <= n; i++) {
    if (sz[i] & 1)
      ans +=
          1ll * (f[i].a[0][0] + f[i].a[1][1]) * (g[i].a[0][0] + g[i].a[1][1]);
    else if (f[i].a[1][0] >= 1 && g[i].a[1][0] >= 1)
      ans += 1ll * sz[i] * (n - sz[i]);
  }
  cout << ans;
  return 0;
}
