#include <bits/stdc++.h>
const int max_n = 200000;
int n;
std::vector<int> T[max_n];
struct Result {
  bool req = false;
  bool created = false;
  int cost = 0;
};
Result gogo(int v, int u) {
  if (T[v].size() == 1 && v != 0) {
    Result ans;
    ans.req = true;
    ans.created = false;
    return ans;
  }
  Result res;
  bool child_require_edge = false;
  bool child_created_edge = false;
  for (int i = 0; i < T[v].size(); ++i) {
    if (T[v][i] != u) {
      Result sub_res = gogo(T[v][i], v);
      if (sub_res.req) child_require_edge = true;
      if (sub_res.created) child_created_edge = true;
      res.cost += sub_res.cost;
    }
  }
  if (child_require_edge) {
    res.req = false;
    res.created = true;
    res.cost += u != 0 ? 1 : 0;
  } else {
    if (child_created_edge) {
      res.req = false;
      res.created = false;
    } else {
      res.req = true;
      res.created = false;
    }
  }
  return res;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    std::cin >> u >> v;
    --u, --v;
    T[u].push_back(v);
    T[v].push_back(u);
  }
  std::cout << gogo(0, 0).cost;
  return 0;
}
