package CF630;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.InputMismatchException;
public class F {
private static int n;
private static HashMap
<Integer, ArrayList
<Integer
>> g
; private static long ans = 0;
// private static final int MOD = 998244353;
public static void main
(String[] args
) { n = ini();
g = new HashMap<>();
for(int i=0; i<n; i++) {
g.put(i, new ArrayList<>());
}
for(int i=0; i<n-1; i++) {
int u = ini()-1;
int v = ini()-1;
g.get(u).add(v);
g.get(v).add(u);
}
println((dfs(0, -1, 0, 0)-1));
out.flush();
out.close();
}
private static long dfs(int u, int p, int ps, int plink) {
//solve for subtree rooted at u with parent p such that p is colored if ps
//and p is linked to u if plink
long ans = 1;
for(int v: g.get(u)) {
if (v==p) continue;
if (plink==1) {
if (ps==0) {
ans = (ans*(dfs(v, u, 0, 0)+dfs(v, u, 1, 1)+dfs(v, u, 0, 0)+dfs(v, u, 0, 1)));
} else {
ans = (ans*(dfs(v, u, 0, 0)+dfs(v, u, 0, 1)));
}
} else {
ans = (ans*(dfs(v, u, 1, 1)+dfs(v, u, 0, 1)+dfs(v, u, 0, 0)));
}
}
return ans;
}
//NONPROBLEM CODE
private static InputReader in
= new InputReader
(System.
in);
private static class InputReader {
private final byte[] buf = new byte[8192];
private int curChar, snumChars;
this.stream = st;
}
public int read() {
if (snumChars == -1)
throw new InputMismatchException();
if (curChar >= snumChars) {
curChar = 0;
try {
snumChars = stream.read(buf);
throw new InputMismatchException();
}
if (snumChars <= 0)
return -1;
}
return buf[curChar++];
}
public int nextInt() {
int c = read();
while (isSpaceChar(c)) {
c = read();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
int res = 0;
do {
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
public long nextLong() {
int c = read();
while (isSpaceChar(c)) {
c = read();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
long res = 0;
do {
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
public int[] nextIntArray(int n) {
int a[] = new int[n];
for (int i = 0; i < n; i++) {
a[i] = nextInt();
}
return a;
}
int c = read();
while (isSpaceChar(c)) {
c = read();
}
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = read();
} while (!isSpaceChar(c));
return res.toString();
}
int c = read();
while (isSpaceChar(c))
c = read();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = read();
} while (!isEndOfLine(c));
return res.toString();
}
public boolean isSpaceChar(int c) {
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
private boolean isEndOfLine(int c) {
return c == '\n' || c == '\r' || c == -1;
}
}
//INPUT SHORTCUTS
private static int[] ina(int n) {
int[] temp = new int[n];
for (int i = 0; i < n; i++) {
temp[i] = in.nextInt();
}
return temp;
}
private static int ini() {
return in.nextInt();
}
//OTHER SHORTCUTS
public static void sort(int[] a) {
}
//PRINT SHORTCUTS
private static void println
(Object...
o) { out.write(x + " ");
}
out.write("\n");
out.flush();
}
private static void print
(Object...
o) { out.write(x + " ");
}
out.flush();
}
private static void debug
(Object...
o) { out.write(x + " ");
}
out.write("\n");
out.flush();
}
}
cGFja2FnZSBDRjYzMDsKCmltcG9ydCBqYXZhLmlvLklPRXhjZXB0aW9uOwppbXBvcnQgamF2YS5pby5JbnB1dFN0cmVhbTsKaW1wb3J0IGphdmEuaW8uUHJpbnRXcml0ZXI7CmltcG9ydCBqYXZhLnV0aWwuQXJyYXlMaXN0OwppbXBvcnQgamF2YS51dGlsLkFycmF5czsKaW1wb3J0IGphdmEudXRpbC5IYXNoTWFwOwppbXBvcnQgamF2YS51dGlsLklucHV0TWlzbWF0Y2hFeGNlcHRpb247CgpwdWJsaWMgY2xhc3MgRiB7Cglwcml2YXRlIHN0YXRpYyBpbnQgbjsKCXByaXZhdGUgc3RhdGljIEhhc2hNYXA8SW50ZWdlciwgQXJyYXlMaXN0PEludGVnZXI+PiBnOwoJcHJpd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