#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
int in[maxn];
int main() {
  int n, u, v;
  while (~scanf("%d", &n)) {
    int ans = 0;
    memset(in, 0, sizeof(in));
    for (int i = 1; i < n; i++) {
      scanf("%d%d", &u, &v);
      in[u]++;
      in[v]++;
    }
    for (int i = 1; i <= n; i++) {
      if (in[i] == 1) ans++;
    }
    cout << ans << endl;
  }
  return 0;
}
