#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 3;
const int inf = 0x3f3f3f3f;
void read(int &x) {
  char ch;
  bool flag = 0;
  for (ch = getchar(); !isdigit(ch) && ((flag |= (ch == '-')) || 1);
       ch = getchar())
    ;
  for (x = 0; isdigit(ch); x = (x << 1) + (x << 3) + ch - 48, ch = getchar())
    ;
  x *= 1 - 2 * flag;
}
vector<int> vec[maxn];
int main() {
  int n;
  read(n);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    read(a), read(b);
    vec[a].push_back(b);
    vec[b].push_back(a);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++)
    if (vec[i].size() == 1) ans++;
  cout << ans << endl;
  return 0;
}
