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).
#include <bits/stdc++.h>
using namespace std;
template <typename T>
using V = vector<T>;
template <typename T>
using VV = vector<V<T>>;
template <typename T>
using Mi = map<long long, T>;
template <typename T>
using MMi = map<long long, Mi<T>>;
vector<long long> tree;
void build(vector<long long> &arr, long long ind, long long l, long long r) {
  if (l == r) {
    tree[ind] = arr[l];
    return;
  }
  long long mid = (l + r) / 2;
  build(arr, ind * 2, l, mid);
  build(arr, ind * 2 + 1, mid + 1, r);
  tree[ind] = max(tree[ind * 2], tree[ind * 2 + 1]);
}
long long getMax(long long ind, long long tl, long long tr, long long l,
                 long long r) {
  if (l > r) return 0;
  if (l == tl && r == tr) return tree[ind];
  long long tm = (tl + tr) / 2;
  long long a = getMax(ind * 2, tl, tm, l, min(r, tm));
  long long b = getMax(ind * 2 + 1, tm + 1, tr, max(l, tm + 1), r);
  return max(a, b);
}
vector<bool> prim;
void er() {
  long long n = 1e6;
  prim = vector<bool>(n + 1, true);
  prim[0] = prim[1] = false;
  for (long long i = 2; i <= n; i++) {
    if (prim[i]) {
      for (long long j = i * i; j <= n; j += i) {
        prim[j] = false;
      }
    }
  }
}
void ds(long long ind, vector<vector<long long>> &g, vector<bool> &viz) {
  viz[ind] = true;
  for (long long nind : g[ind]) {
    if (!viz[nind]) {
      ds(nind, g, viz);
    }
  }
}
void bfs(long long ind, vector<vector<long long>> &g, vector<long long> &rast) {
  long long len = g.size();
  vector<bool> viz(len, false);
  viz[ind] = true;
  queue<long long> q;
  q.push(ind);
  while (!q.empty()) {
    long long v = q.front();
    q.pop();
    for (long long u : g[v]) {
      if (!viz[u]) {
        viz[u] = true;
        rast[u] = rast[v] + 1;
        q.push(u);
      }
    }
  }
}
long long ans = 0;
void dfs(long long v, vector<vector<long long>> &g, vector<bool> &viz,
         vector<long long> &dost, set<long long> &list) {
  viz[v] = true;
  if (list.find(v) != list.end()) {
    dost[v] = 2;
  } else {
    vector<bool> f(4, false);
    for (long long u : g[v]) {
      if (!viz[u]) {
        dfs(u, g, viz, dost, list);
        f[dost[u]] = true;
      }
    }
    if (f[2]) {
      dost[v] = 1;
      ans++;
    } else if (f[1]) {
      dost[v] = 3;
    } else {
      dost[v] = 2;
    }
  }
}
bool comp(const pair<long long, long long> &a,
          const pair<long long, long long> &b) {
  return max(a.first, a.second) < max(b.first, b.second);
}
long long rast(pair<long long, long long> &a, pair<long long, long long> &b) {
  return abs(a.first - b.first) + abs(a.second - b.second);
}
vector<long long> z_function(string &s) {
  long long n = s.length();
  vector<long long> z(n, 0);
  long long l = 0, r = 0;
  for (long long i = 1; i < n; i++) {
    if (i <= r) {
      z[i] = min(r - i + 1, z[i - l]);
    }
    while (i + z[i] < n && s[z[i]] == s[z[i] + i]) {
      z[i]++;
    }
    if (i + z[i] - 1 > r) {
      l = i;
      r = i + z[i] - 1;
    }
  }
  return z;
}
long long rast(pair<long long, long long> p) {
  return max(0ll, p.second - p.first);
}
pair<long long, long long> ob(pair<long long, long long> a,
                              pair<long long, long long> b) {
  pair<long long, long long> c;
  c.first = max(a.first, b.first);
  c.second = min(a.second, b.second);
  return c;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  vector<vector<long long>> g(n);
  for (int i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  set<long long> list;
  for (int i = 1; i < n; i++) {
    if (g[i].size() == 1) {
      list.insert(i);
    }
  }
  vector<bool> viz(n, false);
  vector<long long> dost(n);
  dfs(0, g, viz, dost, list);
  if (dost[0] == 1) {
    ans--;
  }
  for (long long v : g[0]) {
    if (dost[v] == 1) {
      ans--;
    }
  }
  cout << ans;
  return 0;
}
