You are given an undirected tree consisting of n vertices. An undirected tree is a connected undirected graph with n - 1 edges.

Your task is to add the minimum number of edges in such a way that the length of the shortest path from the vertex 1 to any other vertex is at most 2. Note that you are not allowed to add loops and multiple edges.

Input

The first line contains one integer n (2 ≤ n ≤ 2 ⋅ 10^5) — the number of vertices in the tree.

The following n - 1 lines contain edges: edge i is given as a pair of vertices u_i, v_i (1 ≤ u_i, v_i ≤ n). It is guaranteed that the given edges form a tree. It is guaranteed that there are no loops and multiple edges in the given edges.

Output

Print a single integer — the minimum number of edges you have to add in order to make the shortest distance from the vertex 1 to any other vertex at most 2. Note that you are not allowed to add loops and multiple edges.

Examples

Input

7
1 2
2 3
2 4
4 5
4 6
5 7


Output

2


Input

7
1 2
1 3
2 4
2 5
3 6
1 7


Output

0


Input

7
1 2
2 3
3 4
3 5
3 6
3 7


Output

1

Note

The tree corresponding to the first example: <image> The answer is 2, some of the possible answers are the following: [(1, 5), (1, 6)], [(1, 4), (1, 7)], [(1, 6), (1, 7)].

The tree corresponding to the second example: <image> The answer is 0.

The tree corresponding to the third example: <image> The answer is 1, only one possible way to reach it is to add the edge (1, 3).



import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
public class Main {

    public void sort(long b[]){
        Random rd = new Random();
        for(int i=1;i<b.length;++i){
            int c = rd.nextInt(i);
            long v = b[c];
            b[c] = b[i];
            b[i] = v;
        }
        Arrays.sort(b);
    }
    public void sort(int b[]){
        Random rd = new Random();
        for(int i = 1;i<b.length;++i){
            int c = rd.nextInt(i);
            int v = b[c];
            b[c]= b[i];
            b[i] = v;
        }
        Arrays.sort(b);
    }

    static int groups = 0;
    static int[] fa;
    static int[] sz;

    static void init(int n) {
        groups = n;
        fa = new int[n];
        for (int i = 1; i < n; ++i) {
            fa[i] = i;
        }
        sz = new int[n];
        Arrays.fill(sz, 1);
    }

    static int root(int p) {
        while (p != fa[p]) {
            fa[p] = fa[fa[p]];
            p = fa[p];
        }
        return p;
    }

    static void combine(int p, int q) {
        int i = root(p);
        int j = root(q);
        if (i == j) {
            return;
        }
        if (sz[i] < sz[j]) {
            fa[i] = j;
            sz[j] += sz[i];
        } else {
            fa[j] = i;
            sz[i] += sz[j];
        }
        groups--;
    }

    class Pair {
        long x;long y;
        Pair(long xx,long yy){
            x = xx;y= yy;
            long g = gcd(Math.abs(x),Math.abs(y));
            if(xx*yy>=0){
                x = Math.abs(x)/g;
                y = Math.abs(y)/g;
            }else{
                x = -Math.abs(x)/g;
                y = Math.abs(y)/g;
            }
        }

        public boolean equals(Object fk){
            Pair p = (Pair)fk;
            return x == p.x && y== p.y;
        }

        public int hashCode(){
            return (int)(x*37+y);
        }

    }

    void dfs(int g, List<Integer> go[],boolean vis[]){
        vis[g] = true;
        for(int u: go[g]){
            int to = u;
            if(!vis[to]) {
                dfs(to, go, vis);
            }
        }

    }

    public static void main(String[] args) throws Exception {
        new Main().run();}


    TreeMap<Integer,Integer> tmp = new TreeMap<>();

    void remove(int u){
        int v = tmp.get(u);
        if(v==1){
            tmp.remove(u);
        }else{
            tmp.put(u,v-1);
        }
    }


//    int dfs(int rt){
//        dp[rt][2] = 1;
//        for(int i=h[rt];i!=-1;i=ne[i]){
//            if(to[i]==fa[to[i]]) continue;
//            dfs(to[i]);
//            dp[rt][0] += dp[to[i]][1];
//            dp[rt][2] += dp[to[i]][1];
//        }
//
//        for(int i=h[rt];i!=-1;i=ne[i]){
//            if(to[i]==fa[to[i]]) continue;
//
//        }
//
//
//    }

    int dp[][];
    void solve(){

        int n = ni();

        boolean f[] = new boolean[n+1];
        int q[] = new int[n];
        int e = 0;int s = 0;
        h = new int[n+1];
        Arrays.fill(h,-1);
        to = new int[2*n];
        ne = new int[2*n];

        int fa[] = new int[n+1];
        int dis[] = new int[n+1];
        dp = new int[n+1][3];
        for(int i=0;i<n-1;++i){
            int u = ni();
            int v = ni();
            add(u,v);
            add(v,u);
        }
        int st[] = new int[n+10];
        int p = 0;
        st[p++] = 1;

        List<int[]> list = new ArrayList<>();

        while(p>0){
            int c = st[p-1];--p;
            int ct = 0;
            for(int i=h[c];i!=-1;i=ne[i]){
                if(to[i]==fa[c]) continue;
                fa[to[i]] = c;
                dis[to[i]] = dis[c]+1;
                list.add(new int[]{dis[c]+1, to[i]});
                ct++;
                st[p++] = to[i];
            }
        }
        boolean pc[] =new boolean[n+1];
        int all = 0;
        Collections.sort(list,(x,y)->{return y[0]- x[0];});
        f[0]  =true;
        f[1]  =true;
        for(int u[]:list){
            if(pc[u[1]]&&!f[u[1]]||dis[u[1]]<=2) continue;
            if(f[u[1]]){
                int cur = u[1];
                cur = fa[cur];
                pc[cur] = true;
            }else{
                boolean ok = f[fa[u[1]]];
                if(!ok) {
                    f[fa[u[1]]] = true;
                    all++;
                }else{
                    pc[fa[u[1]]] = true;
                }


            }

        }
        println(all);































//         PriorityQueue<int[]> q= new PriorityQueue<>((x,y)->{return x[0]-y[0];});
//
//         q.offer(new int[]{0,0});
//         boolean inq[] = new boolean[n];
//         while(q.size()>0){
//             int c[]= q.poll();
//             for(int i=h[c[1]];i!=-1;i=ne[i]){
//                 if(!inq[to[i]]) {
//                     q.offer(new int[]{ wt[i], to[i]});
//                     inq[to[i]] = true;
//                 }
//             }
//         }





    }


    int err = 0;



    void go(int rt,int pt,int fa) {
        stk[rt] = pt;
        for(int i=h[rt];i!=-1;i=ne[i]) {
            if(to[i]==pt||to[i]==fa) continue;
            go(to[i],pt,rt);
        }
    }



    int ct = 0;
    void add(int u,int v){
        to[ct] = v;

        ne[ct] = h[u];
        h[u] = ct++;
//
//        to1[ct] = u;
//        wt1[ct] = w;
//        ne1[ct] = h1[v];
//        h1[v] = ct++;
    }
    int []h,ne,to,wt,qt,stk;


    long inv(long a, long MOD) {
        //return fpow(a, MOD-2, MOD);
        return a==1?1:(long )(MOD-MOD/a)*inv(MOD%a, MOD)%MOD;
    }


    void inverse(){
        int MAXN = 10000;
        long inv[] = new long[MAXN+1];
        inv[1] = 1; //注意初始化
        long mod = 1000000007;
        for (int i=2; i<=MAXN; ++i) {
            inv[i] = (mod - mod / i) * inv[(int) (mod % i)] % mod;
        }
    }



    // 计算某个特别大的组合数
    long C(long n,long m, long MOD) {
        if(m+m>n)m=n-m;
        long up=1,down=1;
        for(long i=0;i<m;i++)
        {
            up=up*(n-i)%MOD;
            down=down*(i+1)%MOD;
        }
        return up*inv(down, MOD)%MOD;
    }


    void solve2() {

        int n = ni();
        String s=  ns();
        int g[][] = new int[3][3];
        for(int i = 0;i<n;++i){
            char c = s.charAt(i);
            int idx = 0;
            if(c=='G'){
                idx =1;
            }else if(c=='B'){
                idx =2;
            }
            g[c][i%3]++;
        }







    }































//    int []h,to,ne,wt;

    long t1[];
    //    long t2[];
    void update(long[] t,int i,long v){
        for(;i<t.length;i+=(i&-i)){
            t[i] += v;
        }
    }
    long get(long[] t,int i){
        long s = 0;
        for(;i>0;i-=(i&-i)){
            s += t[i];
        }
        return s;
    }

    int equal_bigger(long t[],long v){
        int s=0,p=0;
        for(int i=Integer.numberOfTrailingZeros(Integer.highestOneBit(t.length));i>=0;--i) {
            if(p+(1<<i)< t.length && s + t[p+(1<<i)] < v){
                v -= t[p+(1<<i)];
                p |= 1<<i;
            }
        }
        return p+1;
    }


    long gcd(long a,long b){ return b==0?a: gcd(b,a%b);}
    InputStream is;PrintWriter out;
    void run() throws Exception {is = System.in;
        //  is = new FileInputStream("C:\\Users\\Luqi\\Downloads\\P1600_2.in");

        out = new PrintWriter(System.out);solve();out.flush();}
    private byte[] inbuf = new byte[2];
    public int lenbuf = 0, ptrbuf = 0;
    private int readByte() {
        if (lenbuf == -1) throw new InputMismatchException();
        if (ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {lenbuf = is.read(inbuf);} catch (IOException e) {throw new InputMismatchException();}
            if (lenbuf <= 0) return -1;
        }
        return inbuf[ptrbuf++];}
    private boolean isSpaceChar(int c) {return !(c >= 33 && c <= 126);}
    private int skip() {int b;while((b = readByte()) != -1 && isSpaceChar(b));return b;}
    private double nd() {return Double.parseDouble(ns());}
    private char nc() {return (char) skip();}
    private char ncc() {int b;while((b = readByte()) != -1 && !(b >= 32 && b <= 126));return (char)b;}
    private String ns() {int b = skip();StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);b = readByte(); }
        return sb.toString();}
    private char[] ns(int n) {char[] buf = new char[n];int b = skip(), p = 0;
        while (p < n && !(isSpaceChar(b))) { buf[p++] = (char) b;b = readByte(); }
        return n == p ? buf : Arrays.copyOf(buf, p);}
    private String nline() {int b = skip();StringBuilder sb = new StringBuilder();
        while (!isSpaceChar(b) || b == ' ') { sb.appendCodePoint(b);b = readByte(); }
        return sb.toString();}
    private char[][] nm(int n, int m) {char[][] a = new char[n][];for (int i = 0; i < n; i++) a[i] = ns(m);return a;}
    private int[] na(int n) {int[] a = new int[n];for (int i = 0; i < n; i++) a[i] = ni();return a;}
    private long[] nal(int n) { long[] a = new long[n];for (int i = 0; i < n; i++) a[i] = nl();return a;}
    private int ni() { int num = 0, b; boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')){};
        if (b == '-') { minus = true; b = readByte(); }
        while (true) {
            if (b >= '0' && b <= '9') num = (num << 3) + (num << 1) + (b - '0');
            else return minus ? -num : num;
            b = readByte();}}
    private long nl() { long num = 0; int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')){};
        if (b == '-') { minus = true; b = readByte(); }
        while (true) {
            if (b >= '0' && b <= '9')  num = num * 10 + (b - '0');
            else return minus ? -num : num;
            b = readByte();}}
    void print(Object obj){out.print(obj);}
    void println(Object obj){out.println(obj);}
    void println(){out.println();}
}