N,M=gets.split.map(&:to_i)
l=Array.new(N){[]}
M.times{
    a,b=gets.split.map{|i|i.to_i-1}
    l[a] << b
    l[b] << a
}
comp=Array.new(N)
closed=Array.new(N){false}
s=[]
N.times{|i|
    next if closed[i]
    s.push(i)
    until s.empty?
        v=s.pop
        closed[v]=true
        comp[v]=i
        l[v].each{|n|
            next if closed[n]
            s.push(n)
        }
    end
}
count=Hash.new{0}
max=0
comp.each{|i|
    count[i]+=1
    if max<count[i]
        max=count[i]
    end
}
puts max
