#include <bits/stdc++.h>
using namespace std;
vector<int> ok[1001];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    ok[a].push_back(b);
    ok[b].push_back(a);
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (ok[i].size() == 1) cnt++;
  printf("%d", cnt);
  return 0;
}
