def connected_components(graph)
	components = []
	visited = [false] * graph.size
	graph.size.times do |i|
		next if visited[i]
		visited[i] = true
		queue = [i]
		component = []
		until queue.empty?
			j = queue.pop
			component << j
			graph[j].each do |k|
				unless visited[k]
					visited[k] = true
					queue << k
				end
			end
		end
		components << component
	end
	components
end

n, m = gets.split.map &:to_i
graph = n.times.map {[]}
m.times do
  a, b = gets.split.map &:to_i
  a -= 1
  b -= 1
  graph[a] << b
  graph[b] << a
end

p connected_components(graph).map(&:size).max