#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
struct Edge {
  int v, nxt;
} edge[maxn << 1];
set<pair<int, int> > ss;
set<pair<int, int> >::iterator it;
int tot, head[maxn], dis[maxn], pre[maxn], res;
void addEdge(int u, int v) {
  edge[tot].v = v;
  edge[tot].nxt = head[u];
  head[u] = tot++;
}
void init() {
  tot = 0;
  memset(head, -1, sizeof(head));
  res = 0;
}
void bfs() {
  queue<int> que;
  memset(dis, -1, sizeof(dis));
  memset(pre, -1, sizeof(pre));
  dis[1] = 0;
  que.push(1);
  while (!que.empty()) {
    int u = que.front();
    que.pop();
    for (int i = head[u]; i + 1; i = edge[i].nxt) {
      if (dis[edge[i].v] == -1) {
        dis[edge[i].v] = dis[u] + 1;
        que.push(edge[i].v);
        pre[edge[i].v] = u;
      }
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  init();
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    addEdge(u, v);
    addEdge(v, u);
  }
  bfs();
  for (int i = 1; i <= n; i++)
    if (dis[i] > 2) ss.insert(make_pair(-dis[i], i));
  while (!ss.empty()) {
    int v = ss.begin()->second;
    v = pre[v];
    res++;
    it = ss.find(make_pair(-dis[v], v));
    if (it != ss.end()) ss.erase(it);
    for (int i = head[v]; i + 1; i = edge[i].nxt) {
      it = ss.find(make_pair(-dis[edge[i].v], edge[i].v));
      if (it != ss.end()) ss.erase(it);
    }
  }
  printf("%d\n", res);
  return 0;
}
