#include <bits/stdc++.h>
using namespace std;
int const MAX = 5e5 + 41;
int const MASK = 4;
int n;
vector<int> e[MAX];
int dc[MAX];
void dfs0(int x, int p = -1) {
  if (p == -1) e[x].push_back(p);
  for (int i = 0; i <= (int)e[x].size() - 1; i++) {
    if (e[x][i] == p) {
      swap(e[x][i], e[x][(int)e[x].size() - 1]);
    }
  }
  e[x].insert(e[x].begin(), p);
  dc[x] = 1;
  for (int y : e[x]) {
    if (y == p) continue;
    dfs0(y, x);
    dc[x] += dc[y];
  }
}
bool bit(int m, int i) { return (1 & (m >> i)); }
int qbit(int m) { return __builtin_popcount(m); }
vector<vector<int> > dp[MAX], ds[MAX];
vector<int> d[MAX];
void dfs1(int x, int p = -1) {
  int k = (int)e[x].size();
  dp[x].assign(k, vector<int>(MASK, 0));
  dp[x][0][0] = 1;
  for (int i = 0; i <= (int)e[x].size() - 2; i++) {
    int y = e[x][i];
    if (y == p) {
      dp[x][i + 1] = dp[x][i];
      continue;
    }
    dfs1(y, x);
    for (int mx = 0; mx <= MASK - 1; mx++) {
      for (int my = 0; my <= MASK - 1; my++) {
        int ways = dp[x][i][mx] * d[y][my];
        int c = (int)bit(mx, 0) + (int)bit(my, 0);
        if (c > 1) continue;
        int mtx = bit(mx, 1);
        int mty = bit(my, 1);
        if (mtx == mty) {
          if (c) {
            dp[x][i + 1][3] += ways;
          } else {
            if (mtx) {
              dp[x][i + 1][2] += ways;
            } else {
              dp[x][i + 1][1] += ways;
              dp[x][i + 1][2] += ways;
            }
          }
        } else {
          if (!c) {
            if (mtx) {
              dp[x][i + 1][3] += ways;
            } else {
              dp[x][i + 1][0] += ways;
            }
          } else {
            if (mty) {
              dp[x][i + 1][1] += ways;
            }
          }
        }
      }
    }
  }
  reverse(e[x].begin(), e[x].end());
  ds[x].assign(k, vector<int>(MASK, 0));
  ds[x][0][0] = 1;
  for (int i = 0; i <= (int)e[x].size() - 2; i++) {
    int y = e[x][i];
    if (y == p) {
      ds[x][i + 1] = ds[x][i];
      continue;
    }
    for (int mx = 0; mx <= MASK - 1; mx++) {
      for (int my = 0; my <= MASK - 1; my++) {
        int ways = ds[x][i][mx] * d[y][my];
        int c = (int)bit(mx, 0) + (int)bit(my, 0);
        if (c > 1) continue;
        int mtx = bit(mx, 1);
        int mty = bit(my, 1);
        if (mtx == mty) {
          if (c) {
            ds[x][i + 1][3] += ways;
          } else {
            if (mtx) {
              ds[x][i + 1][2] += ways;
            } else {
              ds[x][i + 1][1] += ways;
              ds[x][i + 1][2] += ways;
            }
          }
        } else {
          if (!c) {
            if (mtx) {
              ds[x][i + 1][3] += ways;
            } else {
              ds[x][i + 1][0] += ways;
            }
          } else {
            if (mty) {
              ds[x][i + 1][1] += ways;
            }
          }
        }
      }
    }
  }
  reverse(e[x].begin(), e[x].end());
  reverse(ds[x].begin(), ds[x].end());
  d[x] = dp[x][k - 1];
}
long long ans;
vector<int> dup[MAX];
bool can(int c1, int mt1, int c2, int mt2) {
  c1 += (1 - mt1);
  c2 += (1 - mt2);
  if (c1 > 1 || c2 > 1) return false;
  return (c1 == c2);
}
void dfs2(int x, int p = -1) {
  for (int mu = 0; mu <= MASK - 1; mu++) {
    for (int ml = 0; ml <= MASK - 1; ml++) {
      for (int mr = 0; mr <= MASK - 1; mr++) {
        for (int i = 1; i <= (int)e[x].size() - 2; i++) {
          int y = e[x][i];
          int ways = dup[x][mu] * dp[x][i][ml] * ds[x][i][mr];
          if (!ways) continue;
          int c = (int)bit(mu, 0) + (int)bit(ml, 0) + (int)bit(mr, 0);
          if (c > 1) continue;
          int mt = (int)bit(mu, 1) + (int)bit(ml, 1) + (int)bit(mr, 1);
          if (mt > 1) continue;
          if (c) {
            if (mt) {
              dup[y][1] += ways;
            } else {
              dup[y][3] += ways;
            }
          } else {
            if (mt) {
              dup[y][0] += ways;
            } else {
              dup[y][1] += ways;
              dup[y][2] += ways;
            }
          }
          for (int my = 0; my <= MASK - 1; my++) {
            long long ways1 = (long long)ways * d[y][my];
            int cy = bit(my, 0);
            int mty = bit(my, 1);
            if (can(c, mt, cy, mty)) {
              if (mt && mty && !c && !cy) {
                ways1 *= (long long)dc[y] * (n - dc[y]);
              }
              ans += ways1;
            }
          }
        }
      }
    }
  }
  for (int y : e[x]) {
    if (y == p) continue;
    dfs2(y, x);
  }
}
void solve() {
  dfs0(1);
  dfs1(1);
  for (int i = 1; i <= n; i++) {
    dup[i].assign(MASK, 0);
  }
  dup[1][0] = 1;
  dfs2(1);
  printf("%lld\n", ans);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    e[x].push_back(y);
    e[y].push_back(x);
  }
  solve();
  return 0;
}
