local n = io.read("*n") local t = {} for i = 1, n do t[i] = 0 end for i = 1, n - 1 do local a, b = io.read("*n", "*n") t[a] = t[a] + 1 t[b] = t[b] + 1 end local cnt = 0 for i = 1, n do if(t[i] == 1) then cnt = cnt + 1 end end print(cnt - 2)