#include <bits/stdc++.h>
using namespace std;
long long power(long long k, long long n, long long m = 1000000007) {
  long long res = 1;
  while (n) {
    if (n % 2 != 0) {
      res = (res * k) % m;
    }
    k = (k * k) % m;
    n = n / 2;
  }
  return (res);
}
void READ(vector<long long> &v, long long n) {
  long long a;
  for (long long i = 0; i < n; i = i + 1) {
    cin >> a;
    v.push_back(a);
  }
}
void PRINT(vector<long long> &v) {
  long long a;
  for (long long i = 0; i < v.size(); i = i + 1) {
    cout << v[i] << " ";
  }
  cout << "\n";
}
long long n, m, k;
vector<bool> isprime(2750135, true);
vector<long long> pf(2750135, 0);
vector<long long> prime;
void sieve() {
  isprime[0] = isprime[1] = false;
  for (long long i = 2; i < 2750135; i++) {
    if (isprime[i]) {
      for (long long j = 2 * i; j < 2750135; j += i) {
        isprime[j] = false;
        pf[j] = i;
      }
      prime.push_back(i);
    }
  }
}
vector<long long> dist;
vector<long long> par;
vector<vector<long long> > v;
void dfs(long long x, long long pr = -1, long long dst = 0) {
  par[x] = pr;
  dist[x] = dst;
  for (long long j = 0; j < (long long)(v[x]).size(); j++) {
    if (v[x][j] != pr) {
      dfs(v[x][j], x, dst + 1);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  std::cout.unsetf(std::ios::floatfield);
  std::cout.precision(12);
  long long a, b, c, d, e, x, i, j, t, y, w, z, x1, y1, z1, f;
  string str, str1, str2, str4;
  cin >> n;
  v.resize(n + 1);
  dist.resize(n + 1);
  par.resize(n + 1);
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  dfs(1);
  set<pair<long long, long long> > s;
  for (i = 1; i < n + 1; i++) {
    a = dist[i];
    if (a > 2) {
      s.insert(make_pair(-a, i));
    }
  }
  long long ans = 0;
  while ((long long)(s).size()) {
    x = s.begin()->second;
    x = par[x];
    ans++;
    auto it = s.find(make_pair(-dist[x], x));
    if (it != s.end()) {
      s.erase(it);
    }
    for (i = 0; i < v[x].size(); i++) {
      a = v[x][i];
      auto it = s.find(make_pair(-dist[a], a));
      if (it != s.end()) {
        s.erase(it);
      }
    }
  }
  cout << ans;
}
