#include <bits/stdc++.h>
using namespace std;
int n, u, v, ans;
vector<int> adj[1100];
bool vis[1100];
void dfs(int s) {
  vis[s] = 1;
  if (adj[s].size() == 1) ans++;
  for (int i : adj[s]) {
    if (vis[i]) continue;
    dfs(i);
  }
}
int main() {
  cin >> n;
  n--;
  while (n--) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(u);
  cout << ans << endl;
  return 0;
}
