#include <bits/stdc++.h>
using namespace std;
const long long MAX = 2e9, N = 2e5 + 10, MOD = 1e9 + 7, BASE = 1 << 18;
long long n, res;
vector<long long> G[N];
bool vis[N];
long long dfs(long long x) {
  vis[x] = 1;
  long long maxi = -1;
  bool ojciec = false;
  for (long long a : G[x])
    if (!vis[a]) {
      long long dist = dfs(a);
      if (x != 1 && dist >= 1) {
        res++;
        ojciec = true;
      } else
        maxi = max(maxi, dist);
    }
  if (ojciec && maxi == -1) return -2;
  return maxi + 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cerr.tie(0);
  cin >> n;
  for (long long i = ((0)); i <= ((n - 1) - 1); i++) {
    long long a, b;
    cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  dfs(1);
  cout << res;
}
