(n,m)=gets.split.map(&:to_i)
friend_list = ARGF.map{|s|s.split.map(&:to_i).sort}.sort.uniq

tmp=(0...n).map{[]}
friend_list.each{|a,b|
    tmp[a-1] << b-1
    tmp[b-1] << a-1
}

tmp2=(0...n).map{[]}
done_memo=[false]*n
loop do
    idx = done_memo.index{|x|x==false}
    if idx == nil
        break
    end
    queue=tmp[idx]
    done_memo[idx]=true

    loop do
        if queue.size ==0
            break
        end
        r = queue.shift
        if done_memo[r] == false
            done_memo[r]=true
            queue+=tmp[r]
            tmp2[idx] << r
        end
    end
end
p tmp2

p tmp2.map{|a|a.size+1}.max