#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
using namespace std;
template <class T>
inline void sort(T &a) {
  sort((a).begin(), (a).end());
}
template <class T>
inline void rsort(T &a) {
  sort((a).rbegin(), (a).rend());
}
template <class T>
inline void reverse(T &a) {
  reverse((a).begin(), (a).end());
}
const long long N = 2e5;
long long n;
vector<int> G[N];
long long rev[N];
bool used[N], used1[N];
vector<long long> arr;
void dfs(int v = 0, int d = 0, int p = 0) {
  used1[v] = true;
  rev[v] = p;
  for (auto i : G[v])
    if (!used1[i]) dfs(i, d + 1, v);
  if (d > 2) arr.push_back(v);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(20);
  srand(time(NULL));
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs();
  long long ans = 0;
  for (auto i : arr)
    if (!used[i]) {
      ++ans;
      used[rev[i]] = true;
      for (auto j : G[rev[i]]) used[j] = true;
    }
  cout << ans;
  return 0;
}
