#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 2;
int in[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    in[u]++;
    in[v]++;
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) ans += (in[i] == 1);
  cout << ans << endl;
  return 0;
}
