#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n, tot, ans;
int h[N], nex[N << 1], ver[N << 1], dep[N], fa[N];
bool vis[N], op[N];
struct nk {
  int x;
  bool operator<(const nk &b) const { return dep[x] < dep[b.x]; }
  nk(int xx) : x(xx) {}
};
priority_queue<nk> q;
inline void add(int x, int y) {
  nex[tot] = h[x];
  ver[tot] = y;
  h[x] = tot++;
}
inline void dfs(int u, int v) {
  dep[u] = dep[v] + 1;
  fa[u] = v;
  for (int i = h[u]; ~i; i = nex[i]) {
    int j = ver[i];
    if (j == v) continue;
    dfs(j, u);
  }
}
int main() {
  memset(h, -1, sizeof(h));
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y), add(y, x);
  }
  vis[1] = 1;
  for (int i = h[1]; ~i; i = nex[i]) vis[ver[i]] = 1;
  dfs(1, 0);
  for (int i = 1; i <= n; i++) q.push(i);
  while (!q.empty()) {
    nk u = q.top();
    q.pop();
    int x = u.x;
    if (!op[x]) {
      if (vis[x] || vis[fa[x]]) continue;
      ans++;
      vis[fa[x]] = 1;
      for (int i = h[fa[x]]; ~i; i = nex[i]) op[ver[i]] = 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
