#include <bits/stdc++.h>
using namespace std;
int n, x, y, counter;
vector<int> nod[200005];
int dist[200005], parent[200005];
bool ap[200005];
void go_visit(int pos, int last) {
  for (int i = 0; i < nod[pos].size(); i++) {
    if (nod[pos][i] == last) continue;
    parent[nod[pos][i]] = pos;
    dist[nod[pos][i]] = dist[pos] + 1;
    go_visit(nod[pos][i], pos);
    if (dist[nod[pos][i]] > 2) {
      ap[pos] = 1;
      dist[pos] = 1;
      dist[nod[pos][i]] = 2;
      dist[parent[pos]] = min(2, dist[parent[pos]]);
    }
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    cin >> x >> y;
    nod[x].push_back(y);
    nod[y].push_back(x);
  }
  go_visit(1, 0);
  for (int i = 1; i <= n; i++) counter += ap[i];
  cout << counter;
  return 0;
}
