require 'pp'
require 'set'

n, m = gets.split.map(&:to_i)
x = []
path = {}
m.times do |i|
    a, b = gets.split.map(&:to_i)
    x << [a, b]
    path[a] ||= []
    path[a] << b
    path[b] ||= []
    path[b] << a
end

#spp path

if m == 0
    puts 1
    exit 0
end

visited = Array.new(n + 1, -1)
num = 0
i = 0

while path.empty?.!
    a, b = path.first
    path.delete(a)
    visited[a] = num

    stack = []
    b.each do |t|
        stack.push([t, num])
    end

    ##pp path
    #pp stack
    while stack.empty?.!
        k, num = stack.shift
        visited[k] = num
        nex = path.delete(k)
        if nex
            nex.each do |i|
                if visited[i] == -1
                    stack.push([i, num])
                end
            end
        end
    end

    num += 1
end

#pp visited
ans = visited.tally
ans.delete(-1)
puts ans.values.max
