#include <bits/stdc++.h>
using namespace std;
vector<int> graph[100000];
bool vis[100000];
int co = 0;
void dfs(int curr) {
  vis[curr] = true;
  if (graph[curr].size() == 1) {
    co++;
  }
  for (int i = 0; i < graph[curr].size(); i++) {
    if (!vis[graph[curr][i]]) {
      dfs(graph[curr][i]);
    }
  }
}
int main() {
  int N, u, v;
  cin >> N;
  memset(vis, false, sizeof(vis));
  for (int i = 0; i < N - 1; i++) {
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  for (int i = 1; i <= N - 1; i++) {
    if (!vis[i]) {
      dfs(i);
    }
  }
  for (int i = 0; i < 100000; i++) {
    graph[i].clear();
  }
  cout << co << endl;
  return 0;
}
