#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
vector<int> g[N];
int ans;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int b, c;
    scanf("%d%d", &b, &c);
    g[b].push_back(c);
    g[c].push_back(b);
  }
  for (int i = 1; i <= n; i++) {
    if (g[i].size() == 1) {
      ans++;
    }
  }
  cout << ans;
}
