N,M = gets.split.map &:to_i
ABs = M.times.map { gets.split.map(&:to_i) }

F = Array.new(N+1){[]}
ABs.each do |a,b|
    F[a] << b
    F[b] << a
end

ans = 0
Mark = []
FCount = ->(n){
    return 0 if Mark[n]
    Mark[n] = true
    ret  = 1
    F[n].each do |f|
        ret += FCount.call(f)
    end
    ret
}

p (1..N).map{ FCount.call(_1)}.max