using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Globalization;
using System.Diagnostics;



class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }


    Scanner cin;


    int N;
    int[] A;
    int[] B;
    List<int>[] es;

    void calc()
    {
        cin = new Scanner();
        DateTime dt = DateTime.Now;
        N = cin.nextInt();
        A = new int[N];
        B = new int[N];
        es = new List<int>[N];

        for (int i = 0; i < N; i++)
        {
            es[i] = new List<int>();
        }

        int[] sum = new int[N];
        for (int i = 0; i < N - 1; i++)
        {
            A[i] = cin.nextInt();
            B[i] = cin.nextInt();
            sum[A[i]]++;
            sum[B[i]]++;
            es[A[i]].Add(B[i]);
            es[B[i]].Add(A[i]);
        }

        rnd = new XRand();

        int ans = 99999999;
        for (int i = 0; i < N; i++)
        {
            if(sum[i] == 1)
            {
                ans = (dfs(i, -1) + 1) / 2;
                break;
            }
        }

        Console.WriteLine(ans);
    }

    int dfs(int a, int pre)
    {
        int ans = 0;
        int tmp = 0;
        int min = 999999;
        int zerocount = 0;
        int flag = 0;
        int ret = 0;
        foreach (var next in es[a])
        {
            if (next == pre) continue;
            tmp++;
            ret = dfs(next, a);
            ans += ret / 2;
            if (ret < 2) zerocount++;
            min = Math.Min(ret, min);
        }
        if (tmp == 0) return 1;
        if(tmp == 1)
        {
            return ret;
        }
        if (min <= 1) flag = 1;
        //ans = Math.Max(ans, tmp - 1);
        ans += Math.Max(0, zerocount - 1);
        return ans * 2 + flag;
    }

    XRand rnd;

    //配列のランダム並び替え
    void randomshuffle<T>(T[] a)
    {
        int len = a.Length;
        for (int i = 0; i < len - 1; i++)
        {
            swap(ref a[i], ref a[i + rnd.nextInt(len - i)]);
        }
    }

    //swap
    void swap<T>(ref T a, ref T b)
    {
        T c = a;
        a = b;
        b = c;
    }


    class XRand
    {
        uint x, y, z, w;


        public XRand()
        {
            init();
        }

        public XRand(uint s)
        {
            init();
            init_xor128(s);
        }

        void init()
        {
            x = 314159265; y = 358979323; z = 846264338; w = 327950288;

        }

        public void init_xor128(uint s)
        {
            z ^= s;
            z ^= z >> 21; z ^= z << 35; z ^= z >> 4;
            z *= 736338717;
        }

        uint next()
        {
            uint t = x ^ x << 11; x = y; y = z; z = w; return w = w ^ w >> 19 ^ t ^ t >> 8;
        }

        public long nextLong(long m)
        {
            return (long)((((ulong)next() << 32) + next()) % (ulong)m);
        }

        public int nextInt(int m)
        {
            return (int)(next() % m);
        }

        public int nextIntP(int a)
        {
            return (int)Math.Pow(a, nextDouble());
        }

        public int nextInt(int min, int max)
        {
            return min + nextInt(max - min + 1);
        }


        public double nextDouble()
        {
            return (double)next() / uint.MaxValue;
        }

        public double nextDoubleP(double a)
        {
            return Math.Pow(a, nextDouble());
        }
    }


}


class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}


Measured memory_bytes: 44044