#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int n, a, b, d[200007], p[200007];
long long ans = 0;
vector<int> vec[200007];
bool vis[200007], de[200007];
set<pair<int, int>> st;
void dfs(int x, int f, int pa) {
  vis[x] = true;
  d[x] = f;
  p[x] = pa;
  for (int i = 0; i < (int)vec[x].size(); i++) {
    if (!vis[vec[x][i]]) dfs(vec[x][i], f + 1, x);
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &a, &b);
    vec[a].push_back(b);
    vec[b].push_back(a);
  }
  dfs(1, 0, 0);
  for (int i = 1; i <= n; i++) {
    if (d[i] > 2) st.insert(make_pair(-d[i], i));
  }
  while (!st.empty()) {
    ans++;
    int w1 = st.begin()->second, w2;
    w2 = p[w1];
    for (int i = 0; i < (int)vec[w2].size(); i++) {
      if (st.count(make_pair(-d[vec[w2][i]], vec[w2][i])))
        st.erase(make_pair(-d[vec[w2][i]], vec[w2][i]));
    }
    st.erase(make_pair(-d[w2], w2));
  }
  cout << ans << '\n';
  return 0;
}
