#include <bits/stdc++.h>
using namespace std;
const int M = 1e4;
int cnt = 0;
vector<int> v[M];
void dfs(int u, int p = -1) {
  if (v[u].size() == 1) cnt++;
  for (auto x : v[u]) {
    if (x != p) dfs(x, u);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(1, -1);
  cout << cnt;
  return 0;
}
