{$apptype console}
{$o-,r+,q+}
uses
  sysutils, math;

type
  int = longint;

var
  n : int;
  deg : array[1..100000] of int;
  u, v : int;
  ans : int;
  i : int;

begin
  reset(input, 'space.in');
  rewrite(output, 'space.out');
  read(n);
  if (n = 1) then
  begin
    writeln(0);
    halt(0);
  end;
  fillchar(deg, sizeof(deg), 0);
  for i := 1 to n - 1 do
  begin
    read(u, v);
    inc(deg[u]);
    inc(deg[v]);
  end;  
  ans := 0;
  for i := 1 to n do
  begin
    if (deg[i] > 1) then
    begin
      inc(ans);
    end;
  end;
  writeln(ans);
end.