#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T sqr(T x) {
  return x * x;
}
template <typename T>
inline T gcd(T a, T b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <typename T>
inline T lcm(T a, T b) {
  return (a / gcd(a, b)) * b;
}
template <class T>
inline double dist(pair<T, T> a, pair<T, T> b) {
  return sqrt(sqr(a.first - b.first) + sqr(a.second - b.second));
}
template <class T>
inline T dist_square(pair<T, T> a, pair<T, T> b) {
  return (sqr(a.first - b.first) + sqr(a.second - b.second));
}
template <class T>
inline T cross(pair<T, T> a, pair<T, T> b, pair<T, T> c = {0, 0}) {
  return (a.first - c.first) * (b.second - c.second) -
         (a.second - c.second) * (b.first - c.first);
}
template <class T>
inline T dot(pair<T, T> a, pair<T, T> b, pair<T, T> c = {0, 0}) {
  return (a.first - c.first) * (b.first - c.first) +
         (a.second - c.second) * (b.second - c.second);
}
template <class T>
inline int sign(T a) {
  return (a < 0 ? -1 : a ? 1 : 0);
}
template <class T>
inline int popcnt(T x) {
  int cnt = 0;
  while (x) x = (x & (x - 1)), cnt++;
  return cnt;
}
bool is_prime(long long n) {
  if (n < 2) return 0;
  for (long long i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
long long powi(long long a, long long b, long long mod) {
  long long c = 1;
  while (b) {
    if (b & 1) c = (c * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return c;
}
const double PI = 3.1415926535897932384626433;
const long long LLINF = 9000000000000043LL;
const int INF = 1000000043;
const long long mod7 = 1000000007;
const long long mod9 = 1000000009;
const int MAXN = 1001;
int cnt[MAXN];
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < (n - 1); i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    cnt[a]++;
    cnt[b]++;
  }
  int ans = 0;
  for (int i = 0; i < (n); i++) ans += cnt[i] == 1;
  cout << ans << endl;
}
