#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-6;
const int INF = 0x3fffffff;
const long long LINF = INF * 1ll * INF;
const double PI = acos(-1.0);
vector<int> g[200005];
int d[200005];
int ans;
void dfs(int u, int fa, int dep) {
  bool modify = false;
  d[u] = dep;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v != fa) {
      dfs(v, u, dep + 1);
      if (d[v] > 2) {
        modify = true;
        d[u] = 1;
        d[fa] = min(d[fa], 2);
      }
    }
  }
  if (modify) ans++;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, 0, 0);
  printf("%d\n", ans);
  return 0;
}
