#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
struct node {
  int id, dep;
  bool operator<(const node &b) const { return dep > b.dep; }
};
vector<int> Map[N];
int fq[N], dep[N];
node a[N];
int cnt, vis[N];
void dfs(int u, int f, int step) {
  fq[u] = f;
  dep[u] = step;
  if (step >= 3) {
    a[cnt++] = (node){u, step};
  }
  for (int i = 0; i < Map[u].size(); i++) {
    int to = Map[u][i];
    if (to != f) dfs(to, u, step + 1);
  }
}
void add(int u, int v) {
  Map[u].push_back(v);
  Map[v].push_back(u);
}
int main() {
  int n, u, v;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &u, &v);
    add(u, v);
  }
  cnt = 0;
  dfs(1, -1, 0);
  sort(a, a + cnt);
  memset(vis, 0, sizeof(vis));
  int ans = 0;
  for (int i = 0; i < cnt; i++) {
    int id = a[i].id;
    if (vis[id]) continue;
    ans++;
    if (fq[id] != -1) {
      vis[fq[id]] = 1;
      for (int i = 0; i < Map[fq[id]].size(); i++) {
        int to = Map[fq[id]][i];
        vis[to] = 1;
      }
    } else {
      vis[id] = 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
