#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2e5 + 5;
struct Tuple {
  int node;
  int d;
  Tuple(int node, int d) {
    this->node = node;
    this->d = d;
  }
  bool operator<(const Tuple& rhs) const { return this->d < rhs.d; }
};
priority_queue<Tuple> myHeap;
vector<int> a[MAX_N];
int i, n, x, y, d[MAX_N];
bool viz[MAX_N];
void bfs(int nod_start, int d[]) {
  queue<int> q;
  for (int i = 1; i <= n; ++i) {
    d[i] = -1;
  }
  q.push(nod_start);
  d[nod_start] = 0;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (unsigned int j = 0; j < a[x].size(); ++j) {
      if (d[a[x][j]] == -1) {
        int y = a[x][j];
        d[y] = d[x] + 1;
        q.push(y);
      }
    }
  }
}
int main(int argc, char** argv) {
  cin >> n;
  for (i = 1; i <= n - 1; ++i) {
    cin >> x >> y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  bfs(1, d);
  for (int i = 1; i <= n; ++i) {
    if (d[i] > 2) {
      myHeap.push(Tuple(i, d[i]));
    }
  }
  int count = 0;
  while (!myHeap.empty()) {
    Tuple t = myHeap.top();
    myHeap.pop();
    int x = t.node;
    int px = -1;
    if (!viz[x]) {
      for (int node : a[x]) {
        if (d[node] + 1 == d[x]) {
          px = node;
          break;
        }
      }
      viz[px] = 1;
      for (int node : a[px]) {
        viz[node] = 1;
      }
      ++count;
    }
  }
  cout << count;
  return 0;
}
