#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, s = 0;
  cin >> n;
  vector<int> D[n], T;
  vector<pair<int, int>> K;
  int S[n], g[n], d[n], P[n], t[n];
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    a--;
    b--;
    D[a].push_back(b);
    D[b].push_back(a);
  }
  for (int i = 0; i < n; i++) {
    g[i] = 1;
    S[i] = D[i].size();
    t[i] = 0;
  }
  T.push_back(0);
  g[0] = 0;
  d[0] = 0;
  t[0] = 1;
  for (int i = 0; i < T.size(); i++) {
    for (int y = 0; y < D[T[i]].size(); y++) {
      if (g[D[T[i]][y]] == 1) {
        g[D[T[i]][y]] = 0;
        d[D[T[i]][y]] = d[T[i]] + 1;
        P[D[T[i]][y]] = T[i];
        if (d[D[T[i]][y]] <= 2) {
          t[D[T[i]][y]] = 1;
        }
        if (d[D[T[i]][y]] > 2) {
          K.push_back({d[D[T[i]][y]], D[T[i]][y]});
        }
        T.push_back(D[T[i]][y]);
      }
    }
  }
  sort(K.rbegin(), K.rend());
  T = vector<int>();
  for (int i = 0; i < K.size(); i++) {
    if (t[K[i].second] == 0 && S[K[i].second] <= 1) {
      T.push_back(P[K[i].second]);
      t[K[i].second] = 1;
      t[P[K[i].second]] = 1;
      s++;
      for (int y = 0; y < T.size(); y++) {
        for (int u = 0; u < D[T[y]].size(); u++) {
          t[D[T[y]][u]] = 1;
          a = D[T[y]][u];
          for (int j = 0; j < D[a].size(); j++) {
            if (t[D[a][j]] == 0) {
              S[D[a][j]]--;
            }
          }
        }
      }
      T = vector<int>();
    }
  }
  cout << s;
  return 0;
}
