#include <bits/stdc++.h>
using namespace std;
template <typename T>
void chmin(T &x, const T &y) {
  if (x > y) x = y;
}
template <typename T>
void chmax(T &x, const T &y) {
  if (x < y) x = y;
}
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * f;
}
const int N = 2e5 + 10;
int n, cnt, head[N], dep[N], f[N], ans;
bool vis[N];
struct node {
  int to, next;
} edge[N << 1];
inline void add(int u, int v) {
  edge[++cnt] = {v, head[u]};
  head[u] = cnt;
}
struct cmp {
  bool operator()(int x, int y) { return dep[x] < dep[y]; }
};
priority_queue<int, vector<int>, cmp> q;
inline void dfs(int u, int fa) {
  f[u] = fa, dep[u] = dep[fa] + 1;
  for (int i = head[u]; i; i = edge[i].next) {
    int v = edge[i].to;
    if (v == fa) continue;
    dfs(v, u);
  }
}
int main() {
  n = read();
  int u, v;
  for (int i = 1; i < n; i++) {
    u = read(), v = read();
    add(u, v), add(v, u);
  }
  dfs(1, 0);
  for (int i = 1; i <= n; i++)
    if (dep[i] > 3) q.push(i);
  while (!q.empty()) {
    u = q.top();
    q.pop();
    if (vis[u]) continue;
    u = f[u];
    vis[u] = 1;
    for (int i = head[u]; i; i = edge[i].next) v = edge[i].to, vis[v] = 1;
    ans++;
  }
  cout << ans;
  return 0;
  ;
}
