// Задача "Космические путешествия"
// 12-ая Интернет-олимпиада сезона 2006-2007, базовый уровень
// Автор задачи: Федор Царев, tsarev@rain.ifmo.ru
// Автор решения: Федор Царев, tsarev@rain.ifmo.ru

import java.io.*;
import java.util.*;

public class space_ft_assert implements Runnable {

	public final static int MAXN = (int) 1e5;

	private Scanner in;
	private PrintWriter out;
	String fname = "space";

	private void myAssert(boolean e, String message) {
		if (!e) {
			throw new Error("Assertion failure!!! " + message);
		}
	}

	class DSS {
		int[] p;
		int[] s;
		int n;

		public DSS(int n) {
			this.n = n;
			p = new int[n];
			s = new int[n];
			for (int i = 0; i < n; i++) {
				p[i] = i;
				s[i] = 1;
			}
		}

		public boolean join(int x, int y) {
			x = get(x);
			y = get(y);
			if (x == y) {
				return false;
			}		
			if (s[x] > s[y]) {
				p[y] = x;
				s[x] += s[y];
			} else {
				p[x] = y;
				s[y] += s[x];
			}
			return true;
		}

		private int get(int x) {
			if (p[x] == x) {
				return x;
			}
			int res = get(p[x]);
			p[x] = res;
			return res;
		}

	}

	public void solve() {
		int n = in.nextInt();
		if (n == 1) {
			out.println(0);
			return;
		}
		myAssert(1 <= n && n <= MAXN, "n < 1 || n > 10000");
		int[] deg = new int[n];
		DSS dss = new DSS(n);
		for (int i = 0; i < n - 1; i++) {
			int u = in.nextInt();
			int v = in.nextInt();
			myAssert(1 <= u && u <= n, "u < 1 || u > n");
			myAssert(1 <= v && v <= n, "v < 1 || v > n");
			u--;
			v--;
			myAssert(dss.join(u, v), "u and v are in the same connected component");            
			deg[u]++;
			deg[v]++;
		}

		int ans = 0;
		for (int i = 0; i < n; i++) {
			if (deg[i] == 0) {
				myAssert(false, "deg[i] == 0");
			}
			if (deg[i] != 1) {
				ans++;
			}
		}

		out.println(ans);

	}

	public void run() {
		try {
			solve();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		} finally {
			out.close();
		}		
	}

	public space_ft_assert() {
		try {
			in = new Scanner(new File(fname + ".in"));
			out = new PrintWriter(new File(fname + ".out"));
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}


	public static void main(String[] args) {
		new Thread(new space_ft_assert()).start();
	}

}