#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  int a[2002];
  cin >> n;
  int w = 2 * n;
  for (int i = 0; i < (w - 2); i++) {
    cin >> a[i];
  }
  sort(a, a + (w - 2));
  for (int i = 1; i < (w - 3); i++) {
    if (a[i - 1] != a[i] && a[i] != a[i + 1]) sum++;
  }
  if (a[0] != a[1]) sum++;
  if (a[n * 2 - 3] != a[n * 2 - 4]) sum++;
  cout << sum;
  return 0;
}
