#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
int n, sz[N], fa[N];
vector<int> e[N];
long long ans;
void dfs(int x) {
  sz[x] = 1;
  for (auto i : e[x])
    if (i != fa[x]) {
      fa[i] = x;
      dfs(i);
      sz[x] += sz[i];
    }
}
void count() {
  int sum = 0;
  for (int i = (int)(1); i <= (int)(n); i++) {
    int sum = 0;
    for (auto j : e[i])
      if (j != fa[i]) sum += sz[j] & 1;
    if (sum != (sz[i] - 1) % 2) return;
  }
  for (int i = (int)(1); i <= (int)(n); i++)
    if (sz[i] % 2 == 0) ans += 1ll * (n - sz[i]) * sz[i];
}
long long f[N][3][2][2];
long long tmp[3][2][2];
void dp(int x) {
  f[x][0][0][0] = f[x][1][0][1] = 1;
  for (auto i : e[x])
    if (i != fa[x]) {
      dp(i);
      memset(tmp, 0, sizeof(tmp));
      for (int j = (int)(0); j <= (int)(2); j++)
        for (int k = (int)(0); k <= (int)(2 - j); k++)
          for (int jj = (int)(0); jj <= (int)(1); jj++)
            for (int kk = (int)(0); kk <= (int)(1 - jj); kk++)
              tmp[j + k][jj + kk][0] += f[x][j][jj][0] * f[i][k][kk][1];
      for (int j = (int)(0); j <= (int)(2); j++)
        for (int k = (int)(0); k <= (int)(2 - j); k++)
          for (int jj = (int)(0); jj <= (int)(1); jj++)
            for (int kk = (int)(0); kk <= (int)(1 - jj); kk++)
              tmp[j + k][jj + kk][1] += f[x][j][jj][1] * f[i][k][kk][1];
      for (int j = (int)(0); j <= (int)(2); j++)
        for (int k = (int)(0); k <= (int)(2 - j); k++)
          for (int jj = (int)(0); jj <= (int)(1); jj++)
            for (int kk = (int)(0); kk <= (int)(1 - jj); kk++)
              tmp[j + k][jj + kk][1] += f[x][j][jj][0] * f[i][k][kk][0];
      for (int j = (int)(0); j <= (int)(2); j++)
        for (int k = (int)(0); k <= (int)(2 - j); k++)
          if (k == 1) tmp[j + k][1][0] += f[x][j][0][0] * f[i][k][0][1];
      for (int j = (int)(0); j <= (int)(2); j++)
        for (int k = (int)(0); k <= (int)(2 - j); k++)
          if (k == 1) tmp[j + k][1][1] += f[x][j][0][1] * f[i][k][0][1];
      memcpy(f[x], tmp, sizeof(f[x]));
    }
}
int main() {
  scanf("%d", &n);
  if (n & 1) return puts("0"), 0;
  for (int i = (int)(1); i <= (int)(n - 1); i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    e[x].push_back(y);
    e[y].push_back(x);
  }
  dfs(1);
  count();
  dp(1);
  printf("%lld\n", ans + f[1][2][1][1]);
}
