#!/usr/local/bin/ruby class PlayWithNoel def initialize(*arg) @n,@uv, = arg @adj=Array.new(@n){Array.new} @uv.each{|u,v| @adj[u-1].push(v-1); @adj[v-1].push(u-1)} @match = Array.new(@n) @cover = Array.new(@n) end private def paint(st) rop = false @visited[st] = true @adj[st].each do |v| unless @visited[v] w = @match[v] if w.nil? || @visited[w].nil? && paint(w) rop, @match[st],@match[v] = true,v,st break end end end rop end public def ans r=0 (0...@n).each do |i| unless @match[i] @visited = Array.new(@n) if paint(i) r+=1 end end end @n-r end end ### END: class PlayWithNoel iod = STDIN n = iod.gets.to_i uv = Array.new(n-1){iod.gets.split.map &:to_i} puts PlayWithNoel.new(n,uv).ans exit 0