require 'set'
N, M = gets.split.map &:to_i
link = M.times.map{ gets.split.map &:to_i }
clusters = []
link.each do |a, b|
    if clusters.empty? || !cluster = clusters.find{|c| c.include?(a) || c.include?(b)}
        clusters << Set.new([a, b])
    else
        cluster << a
        cluster << b
    end
end
p clusters.max_by{|cluster| cluster.size}.size