#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> adj;
int par[200005], dist[200005];
long long dp[200005][5];
bool vis[200005];
void dfs(int x, int p, int d) {
  par[x] = p;
  dist[x] = d;
  for (auto nx : adj[x]) {
    if (nx != p) dfs(nx, x, d + 1);
  }
}
long long solve(int x, int d) {
  if (d > 3) return 1e9;
  if (d == 3 && adj[x].size() == 1) return 1;
  long long &ret = dp[x][d];
  if (ret + 1) return ret;
  long long addEdge = 1;
  long long NotAddEdge = 0;
  for (auto nx : adj[x]) {
    if (nx == par[x]) continue;
    addEdge += solve(nx, 2);
    NotAddEdge += solve(nx, d + 1);
  }
  return ret = min(addEdge, NotAddEdge);
}
int main() {
  ios_base::sync_with_stdio(false);
  memset(dp, -1, sizeof dp);
  int n;
  scanf("%d", &n);
  adj.resize(n + 1);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dfs(1, -1, 0);
  vector<int> vec;
  for (int i = 1; i <= n; i++) {
    vec.push_back(i);
  }
  sort(vec.begin(), vec.end(),
       [](int a, int b) -> bool { return dist[a] > dist[b]; });
  long long ans = 0;
  for (auto x : vec) {
    int p = par[x];
    int d = dist[x];
    if (vis[x]) continue;
    if (d > 2) {
      ans++;
      vis[p] = true;
      for (auto nx : adj[p]) vis[nx] = true;
    }
  }
  printf("%lld\n", ans);
}
