#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f;
const long long MOD = 1000000007;
const int IT_MAX = 1 << 17;
const int MX = 1000005;
int cnt[1050];
int main() {
  int N, i;
  scanf("%d", &N);
  for (i = 1; i <= 2 * N - 2; i++) {
    int t;
    scanf("%d", &t);
    cnt[t]++;
  }
  int ans = 0;
  for (i = 1; i <= N; i++)
    if (cnt[i] == 1) ans++;
  return !printf("%d\n", ans);
}
