#include <bits/stdc++.h>
using namespace std;
void fastInOut();
const int N = 1000;
int n, cnt[N];
int main() {
  int a, b, ret = 0;
  cin >> n;
  for (int i = 0; i < n - 1; ++i) cin >> a >> b, ++cnt[a - 1], ++cnt[b - 1];
  for (int i = 0; i < n; ++i) ret += (cnt[i] == 1);
  cout << ret;
  return 0;
}
void fastInOut() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL), cout.tie(NULL);
}
