#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long N = 1e6 + 50;
const long long INF = 2e18;
long long qpower(long long x, long long p, long long M = MOD) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = ans * x % M;
    p >>= 1;
    x = x * x % M;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  long long x;
  while (b) {
    x = a % b;
    a = b;
    b = x;
  }
  return a;
}
long long modp(long long x, long long p = MOD) { return (x % p + p) % p; }
long long addp(long long x, long long y, long long p = MOD) {
  return x + y >= p ? x + y - p : x + y;
}
long long subp(long long x, long long y, long long p = MOD) {
  return x - y < 0 ? x - y + p : x - y;
}
vector<int> E[N];
int ans = 0;
int dep[N];
void dfs(int u, int depth, int fa) {
  dep[u] = depth;
  for (int v : E[u]) {
    if (v != fa) {
      dfs(v, dep[u] + 1, u);
      if (dep[v] == 1) dep[u] = min(dep[u], 2);
      if (dep[v] > 2) ans++, dep[u] = min(dep[u], 1);
    }
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int ui, vi;
  for (int i = 0; i < n - 1; ++i) {
    cin >> ui >> vi;
    E[ui].push_back(vi);
    E[vi].push_back(ui);
  }
  dfs(1, 0, 0);
  cout << ans << endl;
}
