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

#pp path

if m == 0
    puts 1
    exit 0
end

visited = Array.new(n + 1, -1)
num = 0
i = 0
path.each do |k, v|
    if visited[k] != -1
        num = visited[k]
    else
        i += 1
        num = i
    end

    v.each do |t|
        #pp "=="
        #pp k
        #pp t
        if visited[k] == -1 && visited[t] == -1
            visited[k] = num
            visited[t] = num
        elsif visited[k] == -1
            visited[k] = visited[t]
        elsif visited[t] == -1
            visited[t] = visited[k]
        end

        #pp visited
    end
end

ans = visited.tally
ans.delete(-1)

puts ans.values.max
