n,m = gets.split.map &:to_i
$abs = Array.new(n).map{ Hash.new }

m.times{
	a,b = gets.split.map &:to_i
	$abs[a-1][b-1] = true
	$abs[b-1][a-1] = true
}

$walked = Array.new(m, false)

def walk(start)
	next_n = [start]
	$walked[start] = true
	size = 1
	
	while next_n.size > 0
		temp = []
		next_n.each{ |node|
			$abs[node].keys.each{ |k|
				if ! $walked[k] then
					temp << k
					$walked[k] = true
					size += 1
				end
			}
		}
		next_n = temp
	end

	#print size
	size
end

max = 1

$abs.each_with_index{ |nodes, i|
	if nodes.size > 0 && $walked[i] == false then
		size = walk(i)
		if max < size then
			max = size
		end
	end
}

puts max
