#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
int arr[N];
int n, a, b;
int ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    scanf("%d%d", &a, &b);
    arr[a]++;
    arr[b]++;
  }
  for (int i = 1; i <= n; ++i)
    if (arr[i] == 1) ++ans;
  cout << ans;
  return 0;
}
