#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
bool compare(pair<int, int> a, pair<int, int> b) { return (a.first > b.first); }
vector<vector<int>> adj;
vector<int> par, dis;
vector<bool> visited;
void bfs(int src) {
  queue<int> q;
  int u;
  q.push(src);
  visited[src] = true;
  while (!q.empty()) {
    u = q.front();
    q.pop();
    for (int v : adj[u]) {
      if (!visited[v]) {
        visited[v] = true;
        q.push(v);
        dis[v] = dis[u] + 1;
        par[v] = u;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, u, v;
  scanf("%d", &n);
  adj = vector<vector<int>>(n + 1);
  par = vector<int>(n + 1);
  visited = vector<bool>(n + 1, false);
  dis = vector<int>(n + 1, 0);
  for (int i = 0; i < n - 1; i++) {
    scanf("%d %d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  bfs(1);
  vector<pair<int, int>> vc;
  for (int i = 1; i <= n; i++) {
    if (dis[i] > 2) vc.push_back({dis[i], i});
  }
  sort(vc.begin(), vc.end(), compare);
  int ans = 0;
  for (auto it : vc) {
    int ver = it.second;
    if (dis[ver] > 2) {
      ans++;
      dis[par[ver]] = 1;
      for (int i : adj[par[ver]]) dis[i] = 2;
    }
  }
  printf("%d\n", ans);
}
