import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;

public class Bob {
    public static void main(String[] args) throws IOException {

        HashMap<Integer, Integer> retez = new HashMap<>();

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int cnt = Integer.parseInt(br.readLine());

        int result = 0;

        for (int i = 1; i < cnt; i++) {
            String[] nums = br.readLine().split(" ");
            int a = Integer.parseInt(nums[0]);
            int b = Integer.parseInt(nums[1]);

            if(retez.containsKey(a)){
                int val = retez.get(a);
                if(val > 1){
                    result++;
                }
                val++;
                retez.put(a, val);
            }
            else {
                retez.put(a, 1);
            }

            if(retez.containsKey(b)){
                int val = retez.get(b);
                if(val > 1){
                    result++;
                }
                val++;
                retez.put(b, val);
            }
            else {
                retez.put(b, 1);

            }
        }

        System.out.println(result);
    }
}

