#include <iostream>
#include <iomanip>
#include <climits>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <functional>
#include <numeric>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <unordered_map>
#include <random>
#define _USE_MATH_DEFINES
#include <math.h>
#include <complex>

using namespace std;

#define INF (int)1e8
#define _INF (int)-1e8  
#define INFLL (long long)1e15
#define _INFLL (long long)-1e15
#define Loop(i, n) for(int i = 0; i < (int)n; i++)
#define Loop1(i, n) for(int i = 1; i <= (int)n; i++)
#define Loopr(i, n) for(int i = (int)n - 1; i >= 0; i--)
#define Loopr1(i, n) for(int i = (int)n; i >= 1; i--)
#define bitmanip(m,val) static_cast<bitset<(int)m>>(val)
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> P;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;

/*******************************************************/

struct tree_t {
  int n;           // |V|, index begins with 0
  int r;           // root
  vector<P> edges; // E
  vector<ll> cost; // cost or distance
};

class Tree {
private:
  struct node {
    int id; vi childs; int parent; ll cost; int deg; ll d;
    bool operator<(const node & another) const {
      return deg != another.deg ? deg < another.deg : id < another.id;
    }
  };
  int n;
public:
  vector<node> nodes;
  vi leaves;
  int root;
  Tree(tree_t T) {
    n = T.n;
    root = T.r;
    nodes.resize(n);
    Loop(i, n) nodes[i] = { i,{},-1,0,-1,0 };
    map<int, vector<pair<int, ll>>> edges;
    Loop(i, n - 1) {
      if (T.cost.size() == 0) {
        edges[T.edges[i].first].push_back({ T.edges[i].second,1 });
        edges[T.edges[i].second].push_back({ T.edges[i].first,1 });
      }
      else {
        edges[T.edges[i].first].push_back({ T.edges[i].second,T.cost[i] });
        edges[T.edges[i].second].push_back({ T.edges[i].first,T.cost[i] });
      }
    }
    leaves = {};
    stack<int> stk;
    stk.push(root);
    while (stk.size()) {
      int a = stk.top(); stk.pop();
      if (nodes[a].deg != -1) continue;
      if (a == root) nodes[a].deg = 0;
      int leaf_flag = true;
      Loop(i, edges[a].size()) {
        int b = edges[a][i].first;
        if (nodes[b].deg != -1) {
          nodes[a].parent = b;
          nodes[a].cost = edges[a][i].second;
          nodes[a].deg = nodes[b].deg + 1;
          nodes[a].d = nodes[b].d + nodes[a].cost;
        }
        else {
          leaf_flag = false;
          nodes[a].childs.push_back(b);
          stk.push(b);
        }
      }
      if (leaf_flag) leaves.push_back(a);
    }
    if (n == 1) leaves.push_back(root);
    return;
  }
  int dfs(int k) {
    vi dat;
    Loop(i, nodes[k].childs.size()) {
      dat.push_back(dfs(nodes[k].childs[i]));
    }
    sort(dat.begin(), dat.end(), greater<int>());
    int sum = 0;
    Loop(i, dat.size() - 1) {
      if (dat[i] == 0) sum += 1;
      else sum += dat[i];
    }
    if (dat.size() && dat.back() > 0) sum += dat.back();
    return sum;
  }
};


int main() {
  tree_t T;
  cin >> T.n;
  vi d_cnt(T.n, 0);
  Loop(i, T.n - 1) {
    int a, b; cin >> a >> b;
    T.edges.push_back({ a, b });
    d_cnt[a]++;
    d_cnt[b]++;
  }
  bool path_flag = true;
  Loop(i, d_cnt.size()) {
    if (d_cnt[i] >= 3) {
      path_flag = false;
      T.r = i;
    }
  }
  if (path_flag) {
    cout << 1 << endl;
    return 0;
  }
  else {
    Tree *tree = new Tree(T);
    cout << tree->dfs(T.r) << endl;
    return 0;
  }
}

Measured memory_bytes: 26100