#include <bits/stdc++.h>
using namespace std;
bool compare(string &s1, string &s2) { return s1.size() < s2.size(); }
map<int, int> m;
vector<int> v1, v2;
long long int n, i, sum = 0, x = 0, l, r = 0, k, cnt = 0, d, t;
string s, st, str;
int main() {
  cin >> t;
  t = t - 1;
  while (t--) {
    int u, v;
    cin >> u >> v;
    m[u]++;
    m[v]++;
  }
  for (auto it : m) {
    if (it.second == 1) cnt++;
  }
  cout << cnt << endl;
  ;
}
