#include <bits/stdc++.h>
using namespace std;
int n, ans;
vector<int> adj[234567];
int par[234567], d[234567];
int dp[2][234567];
bool vis[234567];
int dfs(int x) {
  vis[x] = true;
  int cnt = 0;
  bool OK = false;
  for (int i = 0; i < adj[x].size(); ++i) {
    int u = adj[x][i];
    if (vis[u] == false) {
      d[u] = d[x] + 1;
      int tmp = dfs(u);
      cnt += (tmp == 0 ? 1 : 0);
      if (tmp == 1) OK = true;
    }
  }
  if (OK and cnt == 0) return 2;
  if (d[x] > 1) ans += (cnt > 0 ? 1 : 0);
  return (cnt > 0 ? 1 : 0);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    adj[v].push_back(u);
    adj[u].push_back(v);
  }
  dfs(1);
  cout << ans;
}
