#include <bits/stdc++.h>
struct Node {
  std::vector<Node*> neighbors;
  Node* parent = nullptr;
  bool discovered = false;
  bool fixed = false;
  void addNeighbor(Node& other) { neighbors.push_back(&other); }
};
struct Graph {
  using Nodes = std::vector<Node>;
  Graph(int n_) : n(n_), nodes(Nodes(n)) {}
  int n;
  Nodes nodes;
  std::vector<Node*> badNodes;
  void connect(int v, int w) {
    nodes[v].addNeighbor(nodes[w]);
    nodes[w].addNeighbor(nodes[v]);
  }
  void discover(Node& node, Node* parent, int depth) {
    node.discovered = true;
    node.parent = parent;
    for (auto v : node.neighbors) {
      if (!v->discovered) {
        discover(*v, &node, depth + 1);
      }
    }
    if (depth > 2) badNodes.push_back(&node);
  }
};
int main() {
  int n;
  std::cin >> n;
  Graph graph(n);
  for (int i = 1; i <= n - 1; ++i) {
    int v, w;
    std::cin >> v >> w;
    graph.connect(v - 1, w - 1);
  }
  graph.discover(graph.nodes[0], nullptr, 0);
  int result = 0;
  for (auto v : graph.badNodes) {
    if (!v->fixed) {
      ++result;
      Node& p = *(v->parent);
      p.fixed = true;
      for (auto w : p.neighbors) {
        w->fixed = true;
      }
    }
  }
  std::cout << result << std::endl;
  return 0;
}
