#include <bits/stdc++.h>
using namespace std;
int n, d[200005], ans;
vector<int> g[200005];
void dfs(int v, int p, int dist) {
  d[v] = min(d[v], dist);
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (to == p) continue;
    dfs(to, v, d[v] + 1);
    d[v] = min(d[v], d[to] + 1);
  }
  if (d[v] > 2) {
    d[v] = 2;
    ans += (d[p] != 1);
    d[p] = 1;
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) d[i] = 1000000007ll;
  dfs(1, -1, 0);
  cout << ans << endl;
  return 0;
}
